[release-branch.go1.8] x/tools/godoc: fix redirect to Gerrit

Redirects to /r/NNNN broke due to crbug.com/gerrit/6888.
Alternative URLs are available in the meantime: /NNNN and /c/NNNN.
This change uses the /NNNN format.

Fixes golang/go#21235

Change-Id: Ie30e01bedd7a8277aedd4070b5f82a754521ed03
Reviewed-on: https://go-review.googlesource.com/52150
Reviewed-by: Kevin Burke <kev@inburke.com>
Reviewed-on: https://go-review.googlesource.com/52170
Reviewed-by: Andrew Bonventre <andybons@golang.org>
This commit is contained in:
Andrew Bonventre 2017-07-31 12:13:08 -04:00 committed by Chris Broadfoot
parent 5682db0e91
commit 77187f3c2d
2 changed files with 3 additions and 3 deletions

View File

@ -196,7 +196,7 @@ func clHandler(w http.ResponseWriter, r *http.Request) {
if n, err := strconv.Atoi(id); err == nil && n > 150000 {
target = "https://codereview.appspot.com/" + id
} else {
target = "https://go-review.googlesource.com/r/" + id
target = "https://go-review.googlesource.com/" + id
}
http.Redirect(w, r, target, http.StatusFound)
}

View File

@ -55,8 +55,8 @@ func TestRedirects(t *testing.T) {
"/design/123-foo": {302, "https://github.com/golang/proposal/blob/master/design/123-foo.md"},
"/design/text/123-foo": {302, "https://github.com/golang/proposal/blob/master/design/text/123-foo.md"},
"/cl/1": {302, "https://go-review.googlesource.com/r/1"},
"/cl/1/": {302, "https://go-review.googlesource.com/r/1"},
"/cl/1": {302, "https://go-review.googlesource.com/1"},
"/cl/1/": {302, "https://go-review.googlesource.com/1"},
"/cl/267120043": {302, "https://codereview.appspot.com/267120043"},
"/cl/267120043/": {302, "https://codereview.appspot.com/267120043"},
}