From 5724bdc2fde1ae49ef1d4adfc4971a092333b6dc Mon Sep 17 00:00:00 2001 From: Andrew Bonventre Date: Mon, 31 Jul 2017 12:13:08 -0400 Subject: [PATCH] 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 --- godoc/redirect/redirect.go | 2 +- godoc/redirect/redirect_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/godoc/redirect/redirect.go b/godoc/redirect/redirect.go index c81d05fc..f86e0ada 100644 --- a/godoc/redirect/redirect.go +++ b/godoc/redirect/redirect.go @@ -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) } diff --git a/godoc/redirect/redirect_test.go b/godoc/redirect/redirect_test.go index 8a02de32..cfc2f979 100644 --- a/godoc/redirect/redirect_test.go +++ b/godoc/redirect/redirect_test.go @@ -58,8 +58,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"}, }