Skip to content

Commit db30ebe

Browse files
authored
Only canonicalize header key once in each iteration (#1565)
1 parent fcda45e commit db30ebe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

runtime/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ func annotateContext(ctx context.Context, mux *ServeMux, req *http.Request, rpcM
9696
}
9797

9898
for key, vals := range req.Header {
99+
key = textproto.CanonicalMIMEHeaderKey(key)
99100
for _, val := range vals {
100-
key = textproto.CanonicalMIMEHeaderKey(key)
101101
// For backwards-compatibility, pass through 'authorization' header with no prefix.
102102
if key == "Authorization" {
103103
pairs = append(pairs, "authorization", val)

0 commit comments

Comments
 (0)