Unverified Commit 8fc8626b authored by Simon Esposito's avatar Simon Esposito Committed by GitHub
Browse files

Return 404 on unmatched console paths (#444)

parent 8818f1dd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -123,6 +123,11 @@ func StartConsoleServer(logger *zap.Logger, startupLogger *zap.Logger, db *sql.D
			// Authentication endpoint doesn't require security.
			grpcGateway.ServeHTTP(w, r)
		default:
			// 404 non console endpoints
			if !strings.HasPrefix(r.URL.Path, "/v2/console") {
				w.WriteHeader(http.StatusNotFound)
				return
			}
			// All other endpoints are secured.
			auth, ok := r.Header["Authorization"]
			if !ok || len(auth) != 1 || !checkAuth(config, auth[0]) {