From 3dc1875f54f98a5357dc60aaff5414345d9e060a Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Fri, 6 Dec 2024 21:55:45 +0000
Subject: [PATCH] Fix Bearer auth decode

---
 auth.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/auth.go b/auth.go
index e83223b..fae50a3 100644
--- a/auth.go
+++ b/auth.go
@@ -48,7 +48,7 @@ func handleAuthenticate(w http.ResponseWriter, req *http.Request) {
 
 	if *enableBearerAuth {
 		if auth := req.Header.Get("Authorization"); strings.HasPrefix(auth, "Bearer ") {
-			key, _ := base64.StdEncoding.DecodeString(auth)
+			key, _ := base64.StdEncoding.DecodeString(auth[7:])
 			if username, ok := tokens[string(key)]; ok {
 				status = http.StatusOK
 				log.Printf("auth(%s) -> ok", username)
-- 
GitLab