go /
gddo /
bec6de54da55740cae514eca3d105ddff61a6ed0 Handle vanity redirect to godoc.org
Gddo assumes that the project URL for a vanity import is the page
containing the go-import meta tag for the vanity path.
This change sets the project URL to the resolved package project URL in
the case where the page uses an http-equiv meta tag to redirect the user
back to godoc.org.
Here's an example. The vanity import path "rsc.io/benchstat" resolves to
"gitbub.com/rsc/benchstat". The page at "http://rsc.io/benchstat" has an
http-equiv meta tag the refreshes to "https://godoc.org/rsc.io/benchstat".
Prior to this change, the project name in the gray banner at the top of
the package documentation page linked to "http://rsc.io/benchstat". The
page on rsc.io redirects the user back to the package documentation
page. Clicking the link is a noop.
After this change, the project name in the gray banner links to
https://github.com/rsc/benchstat".
This is a partial fix to issue #270. This change does not handle the
case where the vanity server responds with an HTTP redirect when
?go-get=1 query is not specified.
2 files changed