Skip to content
Snippets Groups Projects
Commit 3dc1875f authored by ale's avatar ale
Browse files

Fix Bearer auth decode

parent a13390aa
No related branches found
No related tags found
No related merge requests found
Pipeline #81790 passed
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment