зеркало из https://github.com/golang/pkgsite.git
internal/frontend: add missing return on invalid tab redirect
When a tab is invalid, the request is redirected to the main page. A missing return is added. Change-Id: I6db77dd456c275a70e68164c6ff75c12a87f012d Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/271417 Trust: Julie Qiu <julie@golang.org> Run-TryBot: Julie Qiu <julie@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org>
This commit is contained in:
Родитель
6d25f509ee
Коммит
6657ef22c5
|
@ -83,6 +83,7 @@ func (s *Server) serveUnitPage(ctx context.Context, w http.ResponseWriter, r *ht
|
|||
// Redirect to clean URL path when tab param is invalid.
|
||||
if _, ok := unitTabLookup[tab]; !ok {
|
||||
http.Redirect(w, r, r.URL.Path, http.StatusFound)
|
||||
return nil
|
||||
}
|
||||
|
||||
um, err := ds.GetUnitMeta(ctx, info.fullPath, info.modulePath, info.requestedVersion)
|
||||
|
|
Загрузка…
Ссылка в новой задаче