diff --git a/auth/jwt.go b/auth/jwt.go index 14dd857d..f5470bba 100644 --- a/auth/jwt.go +++ b/auth/jwt.go @@ -74,8 +74,8 @@ func (amw *jwtMiddleware) claimsToContext(ctx context.Context, claims *JWTClaims } func invalidAuthResponse(w http.ResponseWriter) { - w.WriteHeader(http.StatusUnauthorized) w.Header().Add("Content-Type", "application/json") + w.WriteHeader(http.StatusUnauthorized) if err := json.NewEncoder(w).Encode( apiParams.APIErrorResponse{ Error: "Authentication failed",