From 3e839fdf5f04d79ebd1b14d408e38c3256a736cd Mon Sep 17 00:00:00 2001 From: Sam Therapy Date: Tue, 31 Jan 2023 19:09:17 +0100 Subject: [PATCH] fix(api): 401 on bad auth Signed-off-by: Sam Therapy --- internal/api/api.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/api/api.go b/internal/api/api.go index 6e92894..b1e716f 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -52,6 +52,7 @@ func authFailed(w http.ResponseWriter, r *http.Request, realm string) { w.Header().Set("Content-Type", "text/plain; charset=utf-8") w.Header().Set("X-Content-Type-Options", "nosniff") w.Header().Add("WWW-Authenticate", fmt.Sprintf(`Realm="%s"`, realm)) + w.WriteHeader(http.StatusUnauthorized) resp := internal.Response{ Message: fmt.Sprintf(`Login failed -- Realm="%s"`, realm),