Skip to content

Commit

Permalink
Only canonicalize header key once in each iteration (#1564)
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyi-yan authored Jul 31, 2020
1 parent 2b269c6 commit 3c7c499
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 @@ -93,8 +93,8 @@ func annotateContext(ctx context.Context, mux *ServeMux, req *http.Request) (con
}

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 3c7c499

Please sign in to comment.