From 67d658d1ba610711bdc79a9ab2eb7844e27eaf1f Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Wed, 3 Feb 2021 01:21:15 +0100 Subject: [PATCH] Also allow Bearer token --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 7a1a5a6..ef10067 100644 --- a/main.go +++ b/main.go @@ -1074,7 +1074,7 @@ func main() { func wrapAuth(handler http.HandlerFunc) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { auth := r.Header.Get("Authorization") - if auth == "" || (authToken != "" && auth == "Token "+authToken) { + if auth == "" || (authToken != "" && (auth == "Token "+authToken || auth == "Bearer "+authToken)) { r = r.WithContext(context.WithValue(r.Context(), authKey, auth != "")) // auth == "", require cookie in handler handler.ServeHTTP(w, r)