Use constant instead of repeating the "x-access-token" string over and over

This commit is contained in:
Ralf Haferkamp
2025-04-30 10:17:58 +02:00
parent b41ff0f424
commit 95f28baa52
8 changed files with 15 additions and 14 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ func ExtractAccountUUID(opts ...account.Option) func(http.Handler) http.Handler
}
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
token := r.Header.Get("x-access-token")
token := r.Header.Get(revactx.TokenHeader)
if len(token) == 0 {
roleIDsJSON, _ := json.Marshal([]string{})
ctx := metadata.Set(r.Context(), RoleIDs, string(roleIDsJSON))