golang/go

x/pkgsite: Incorrect rewriting of the repository URL

Open

#79 690 ouverte le 27 mai 2026

Voir sur GitHub
 (4 commentaires) (0 réactions) (0 assignés)Go (133 883 stars) (19 008 forks)batch import
NeedsFixhelp wantedpkgsite

Description

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!

Guide contributeur