aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2021-07-12 15:41:20 -0400
committerRuss Cox <rsc@golang.org>2021-07-12 20:02:05 +0000
commit29745a29f89349b48bbe5fe7fcf7dbee1bbbe1c2 (patch)
tree29d49ea7ec8d74594f37ec9a91ef4b0a445f4a7a
parente8cce616b8addd32be1ed844d94ee219d067034d (diff)
downloadgo-x-website-29745a29f89349b48bbe5fe7fcf7dbee1bbbe1c2.tar.xz
cmd/golangorg: fix, restore tip.golang.org tests
The golang.org health check was failing the tip.golang.org tests because the host enforcer was redirecting an unknown subdomain to golang.org. Make tip a known subdomain to fix the tests, and then restore them. (The standard tip.golang.org setup disables the enforcer instead.) Change-Id: Id15e7bcb3a704b7782e132c4303576f9d3e80cb0 Reviewed-on: https://go-review.googlesource.com/c/website/+/334112 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Julie Qiu <julie@golang.org> Website-Publish: Russ Cox <rsc@golang.org>
-rw-r--r--cmd/golangorg/server.go1
-rw-r--r--cmd/golangorg/testdata/web.txt6
2 files changed, 7 insertions, 0 deletions
diff --git a/cmd/golangorg/server.go b/cmd/golangorg/server.go
index 32614431..dbb8b63c 100644
--- a/cmd/golangorg/server.go
+++ b/cmd/golangorg/server.go
@@ -224,6 +224,7 @@ func fmtHandler(w http.ResponseWriter, r *http.Request) {
var validHosts = map[string]bool{
"golang.org": true,
"golang.google.cn": true,
+ "tip.golang.org": true,
}
// hostEnforcerHandler redirects http://foo.golang.org/bar to https://golang.org/bar.
diff --git a/cmd/golangorg/testdata/web.txt b/cmd/golangorg/testdata/web.txt
index 1fbb0a6a..addbf91f 100644
--- a/cmd/golangorg/testdata/web.txt
+++ b/cmd/golangorg/testdata/web.txt
@@ -98,6 +98,9 @@ redirect == /pkg/
GET https://golang.org/pkg/
redirect == https://pkg.go.dev/std
+GET https://tip.golang.org/pkg/
+redirect == https://pkg.go.dev/std@master
+
GET https://golang.org/pkg?m=old
redirect == /pkg/?m=old
@@ -119,6 +122,9 @@ redirect == https://pkg.go.dev/bufio
GET https://golang.org/pkg/bufio/?GOOS=windows&GOARCH=amd64
redirect == https://pkg.go.dev/bufio?GOOS=windows&GOARCH=amd64
+GET https://tip.golang.org/pkg/bufio/
+redirect == https://pkg.go.dev/bufio@master
+
GET https://golang.org/pkg/bufio/?m=old
body contains href="/pkg/io/?m=old#Writer
body !contains href="/pkg/io/#Writer