From fc9da8e1f374e329d4c1ede457953684e10690a2 Mon Sep 17 00:00:00 2001 From: Ysbrand van Eijck Date: Wed, 8 Dec 2021 13:48:13 +0100 Subject: [PATCH] Adds missing break in header authentication --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 6317b3f..8ffabe1 100644 --- a/main.go +++ b/main.go @@ -276,9 +276,10 @@ func main() { user = strings.TrimLeft(name, prefix) pass = values[0] ok = true + break } } - + if !(ok && authenticate(user, pass)) { w.Header().Set("WWW-Authenticate", `Basic realm="widdler"`) http.Error(w, "Unauthorized", http.StatusUnauthorized)