mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 19:00:46 +00:00
rpc: canonicalize header keys in WithHeaders
WithHeaders assigned header keys verbatim, unlike WithHeader which uses Header.Set and canonicalizes keys. Normalize keys to avoid duplicate headers with different casing.
This commit is contained in:
parent
e3b6d0c86f
commit
0bd3cfbf0c
1 changed files with 1 additions and 1 deletions
|
|
@ -92,7 +92,7 @@ func WithHeaders(headers http.Header) ClientOption {
|
|||
return optionFunc(func(cfg *clientConfig) {
|
||||
cfg.initHeaders()
|
||||
for k, vs := range headers {
|
||||
cfg.httpHeaders[k] = vs
|
||||
cfg.httpHeaders[http.CanonicalHeaderKey(k)] = vs
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue