golang/go

x/pkgsite: incorrect rewriting of the repository URL

Open

#79,690 创建于 2026年5月27日

在 GitHub 查看
 (5 评论) (1 反应) (0 负责人)Go (19,008 fork)batch import
FixPendingNeedsFixhelp wantedpkgsite

仓库指标

Star
 (133,883 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

What is the URL of the page with the issue?

https://pkg.go.dev/lindenii.org/go/furgit@v0.1.180

What is your user agent?

Mozilla/5.0 (X11; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0

Screenshot

Screenshot of the reported URL, with one trailing slash in the Repository URL

What did you do?

Navigate to the specified URL.

Note that the module URL contains the following:

~ $ curl https://lindenii.org/go/furgit
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta name="go-import" content="lindenii.org/go/furgit git https://git.runxiyu.org/furgit.git//">
	</head>
</html>

Note that https://git.runxiyu.org/furgit.git// and https://git.runxiyu.org/furgit.git/ are different URLs, and in this case, serve entirely different content.

What did you see happen?

<h2 class="go-textLabel">Repository</h2>
<div class="UnitMeta-repo">
	<a href="https://git.runxiyu.org/furgit.git/" title="https://git.runxiyu.org/furgit.git/" target="_blank" rel="noopener">
		git.runxiyu.org/furgit.git/
	</a>
</div>

What did you expect to see?

<h2 class="go-textLabel">Repository</h2>
<div class="UnitMeta-repo">
	<a href="https://git.runxiyu.org/furgit.git//" title="https://git.runxiyu.org/furgit.git//" target="_blank" rel="noopener">
		git.runxiyu.org/furgit.git//
	</a>
</div>

Notes

  • The URL should be normalized, yes. However, collapsing // to / is not correct normalization under RFC3986.
  • By contrast, the Go Module Proxy behaves correctly and does not strip any trailing slashes.
  • The meta tag in the module URL is the canonical/authoritative place that specifies the repository URL. The repository URL should not be munged. Of course, normalizing it is OK.

Thanks!

贡献者指南