File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -25,9 +25,9 @@ func StoreWebToken() func(http.Handler) http.Handler {
2525 return func (next http.Handler ) http.Handler {
2626 return http .HandlerFunc (func (responseWriter http.ResponseWriter , request * http.Request ) {
2727 ctx := request .Context ()
28- auth := strings .Split (request .Header .Get (headers .Authorization ), " " )
29- if len (auth ) > 1 && strings .ToUpper ( auth [0 ]) == tokenAuthPrefix {
30- ctx = pmcontext .AddWebTokenToContext (ctx , auth [1 ], signatureAlgorithms )
28+ tokens := strings .Fields (request .Header .Get (headers .Authorization ))
29+ if len (tokens ) == 2 && strings .EqualFold ( tokens [0 ], tokenAuthPrefix ) {
30+ ctx = pmcontext .AddWebTokenToContext (ctx , tokens [1 ], signatureAlgorithms )
3131 }
3232
3333 next .ServeHTTP (responseWriter , request .WithContext (ctx ))
You can’t perform that action at this time.
0 commit comments