diff options
author | David Crawshaw <crawshaw@golang.org> | 2015-09-01 22:25:11 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-09-01 22:25:11 +0000 |
commit | aec51cbb1352eccfd2bf23387a5c3552b2e14dec (patch) | |
tree | e1a90e98c9acd85295efecb9aab03ba8b050d108 | |
parent | 6b4d4e7bb3634f332ef0126f9a98cc3201422409 (diff) | |
parent | 5c915edf6255d95abcd0dd247a38b8ea098e62fc (diff) | |
download | tools-aec51cbb1352eccfd2bf23387a5c3552b2e14dec.tar.gz |
cmd/godoc: redirect /x to subrepo page
automerge: 5c915ed
* commit '5c915edf6255d95abcd0dd247a38b8ea098e62fc':
cmd/godoc: redirect /x to subrepo page
-rw-r--r-- | cmd/godoc/x.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/godoc/x.go b/cmd/godoc/x.go index f638b68..b4af41a 100644 --- a/cmd/godoc/x.go +++ b/cmd/godoc/x.go @@ -52,6 +52,10 @@ func xHandler(w http.ResponseWriter, r *http.Request) { if i := strings.Index(head, "/"); i != -1 { head, tail = head[:i], head[i:] } + if head == "" { + http.Redirect(w, r, "https://godoc.org/-/subrepo", http.StatusTemporaryRedirect) + return + } repo, ok := xMap[head] if !ok { http.NotFound(w, r) |