From e83e2b216c9b9409515daf12607d8d693e083ddd Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 21 May 2020 15:06:02 +0200 Subject: [PATCH] Fix and improve api authentication error --- api/authentication.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/authentication.go b/api/authentication.go index baeba1d..a9b376f 100644 --- a/api/authentication.go +++ b/api/authentication.go @@ -82,7 +82,8 @@ func authMiddleware(next http.Handler) http.Handler { grantAccess, err := authenticator(server, r) if err != nil { log.Warningf("api: authenticator failed: %s", err) - http.Error(w, "Internal Server Error", http.StatusInternalServerError) + http.Error(w, "Bad Request: Could not identify client", http.StatusBadRequest) + return } if !grantAccess { log.Warningf("api: denying api access to %s", r.RemoteAddr)