From c85df2dac7693f1df66c56a8360ce1817723bbd1 Mon Sep 17 00:00:00 2001 From: Drew Bailey <2614075+drewbailey@users.noreply.github.com> Date: Fri, 8 Nov 2019 15:34:35 -0500 Subject: [PATCH] returns a 404 if not found instead of redirect to ui --- command/agent/http.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/command/agent/http.go b/command/agent/http.go index 756b9ea5a..57f2e0afa 100644 --- a/command/agent/http.go +++ b/command/agent/http.go @@ -277,6 +277,11 @@ func handleUI(h http.Handler) http.Handler { func handleRootRedirect() http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + if req.URL.Path != "/" { + w.WriteHeader(http.StatusNotFound) + return + } + http.Redirect(w, req, "/ui/", 307) return })