aboutsummaryrefslogtreecommitdiff
path: root/internal/authz/middleware.go
diff options
context:
space:
mode:
authorMax Resnick <max@ofmax.li>2024-04-02 21:42:47 -0700
committerMax Resnick <max@ofmax.li>2024-04-02 21:42:47 -0700
commit36cf7c3c00688f623d62216e71aa2c73f8e8d78a (patch)
tree96693c604b81637a598c52f5f1dd320fce18fa40 /internal/authz/middleware.go
parent544fd53047b240170ea51abd418f132b69eadf42 (diff)
downloadgo-git-server-36cf7c3c00688f623d62216e71aa2c73f8e8d78a.tar.gz
feat: switch to hex encoding
Diffstat (limited to 'internal/authz/middleware.go')
-rw-r--r--internal/authz/middleware.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/authz/middleware.go b/internal/authz/middleware.go
index 441240f..3c029b0 100644
--- a/internal/authz/middleware.go
+++ b/internal/authz/middleware.go
@@ -3,7 +3,7 @@ package authz
import (
"context"
- "encoding/base64"
+ "encoding/hex"
"fmt"
"log"
"net/http"
@@ -33,7 +33,7 @@ func Authentication(authMap TokenMap, next http.Handler) http.Handler {
http.Error(rw, "Bad Request", http.StatusForbidden)
return
}
- token, err := base64.URLEncoding.DecodeString(p)
+ token, err := hex.DecodeString(p)
if err != nil {
http.Error(rw, "Bad Request", http.StatusBadRequest)
return