From 59b85863cc4658ef459a1368473e16f848090794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferdinand=20M=C3=BCtsch?= Date: Fri, 12 Feb 2021 18:12:46 +0100 Subject: [PATCH] chore: accept bearer prefix in auth header --- utils/auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/auth.go b/utils/auth.go index 111f0da..ab96242 100644 --- a/utils/auth.go +++ b/utils/auth.go @@ -36,7 +36,7 @@ func ExtractBasicAuth(r *http.Request) (username, password string, err error) { func ExtractBearerAuth(r *http.Request) (key string, err error) { authHeader := strings.Split(r.Header.Get("Authorization"), " ") - if len(authHeader) != 2 || authHeader[0] != "Basic" { + if len(authHeader) != 2 || (authHeader[0] != "Basic" && authHeader[0] != "Bearer") { return key, errors.New("failed to extract API key") }