From 7e9549ca07d64fab942f05373521024eb45b2faa Mon Sep 17 00:00:00 2001 From: Shulhan Date: Fri, 10 Nov 2023 01:15:14 +0700 Subject: [DO-NOT-MERGE] cmd/golangorg: allow serving in local as "go.local" Change-Id: I73aa112ba125b56dbdaf2727a3a7165c03de9b3f --- cmd/golangorg/server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cmd') 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 } -- cgit v1.3