Skip to content

Commit

Permalink
Only canonicalize header key once in each iteration (#1565)
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyi-yan authored Aug 1, 2020
1 parent fcda45e commit db30ebe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ func annotateContext(ctx context.Context, mux *ServeMux, req *http.Request, rpcM
}

for key, vals := range req.Header {
key = textproto.CanonicalMIMEHeaderKey(key)
for _, val := range vals {
key = textproto.CanonicalMIMEHeaderKey(key)
// For backwards-compatibility, pass through 'authorization' header with no prefix.
if key == "Authorization" {
pairs = append(pairs, "authorization", val)
Expand Down

0 comments on commit db30ebe

Please sign in to comment.