This commit is contained in:
joffrey-b 2026-04-20 14:56:25 +00:00 committed by GitHub
commit 30f6a86c1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 "