diff options
| -rw-r--r-- | cmd/golangorg/server.go | 4 | ||||
| -rw-r--r-- | internal/pkgdoc/doc.go | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/cmd/golangorg/server.go b/cmd/golangorg/server.go index 3b015f98..827dedba 100644 --- a/cmd/golangorg/server.go +++ b/cmd/golangorg/server.go @@ -552,7 +552,9 @@ func hostEnforcerHandler(h http.Handler) http.Handler { // link back to URLs on the test site. func hostPathHandler(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if r.Host != "localhost" && !strings.HasPrefix(r.Host, "localhost:") && !strings.HasSuffix(r.Host, ".appspot.com") { + if r.Host != "localhost" && !strings.HasPrefix(r.Host, "localhost:") && + !strings.HasSuffix(r.Host, ".appspot.com") && + !strings.HasSuffix(r.Host, `.local`) { h.ServeHTTP(w, r) return } diff --git a/internal/pkgdoc/doc.go b/internal/pkgdoc/doc.go index 75e556df..98d48a67 100644 --- a/internal/pkgdoc/doc.go +++ b/internal/pkgdoc/doc.go @@ -437,7 +437,7 @@ func (d *docs) ServeHTTP(w http.ResponseWriter, r *http.Request) { suffix += "GOARCH=" + url.QueryEscape(goarch) } } - http.Redirect(w, r, "https://pkg.go.dev/"+relpath+suffix, http.StatusTemporaryRedirect) + http.Redirect(w, r, "https://pkg.go.local/"+relpath+suffix, http.StatusTemporaryRedirect) return } |
