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 Auth(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) {
ctx := r.Context()
t := r.Header.Get("x-access-token")
t := r.Header.Get(revactx.TokenHeader)
if t == "" {
errorcode.InvalidAuthenticationToken.Render(w, r, http.StatusUnauthorized, "Access token is empty.")
/* msgraph error for GET https://graph.microsoft.com/v1.0/me