From 77b3efe3790c7dc27ddbde6805997938f358df81 Mon Sep 17 00:00:00 2001 From: joffrey-b Date: Mon, 20 Apr 2026 16:52:21 +0200 Subject: [PATCH] Fix validateAPIKey logging error when Authorization header is absent --- engine/middleware/authenticate.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engine/middleware/authenticate.go b/engine/middleware/authenticate.go index 830fb78..acf4f34 100644 --- a/engine/middleware/authenticate.go +++ b/engine/middleware/authenticate.go @@ -133,6 +133,10 @@ func validateAPIKey(ctx context.Context, store db.DB, r *http.Request) (*models. l.Debug().Msg("ValidateApiKey: Checking if user is already authenticated") authH := r.Header.Get("Authorization") + if authH == "" { + return nil, nil // no header present, not an error + } + var token string if strings.HasPrefix(strings.ToLower(authH), "token ") { token = strings.TrimSpace(authH[6:]) // strip "Token "