diff --git a/server/embed/serve.go b/server/embed/serve.go index 6100ebd0b..23e115d6a 100644 --- a/server/embed/serve.go +++ b/server/embed/serve.go @@ -303,8 +303,12 @@ type accessController struct { } func (ac *accessController) ServeHTTP(rw http.ResponseWriter, req *http.Request) { + if req == nil { + http.Error(rw, "Request is nil", http.StatusBadRequest) + return + } // redirect for backward compatibilities - if req != nil && req.URL != nil && strings.HasPrefix(req.URL.Path, "/v3beta/") { + if req.URL != nil && strings.HasPrefix(req.URL.Path, "/v3beta/") { req.URL.Path = strings.Replace(req.URL.Path, "/v3beta/", "/v3/", 1) }