-
Notifications
You must be signed in to change notification settings - Fork 20.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rpc: add SetHeader method to Client #21392
Conversation
In go-ethereum, 'mu' and 'lock' are the canonical names for lock-typed fields.
This makes the test less reliant on client internals.
http.Header usually shouldn't be modified using map operations because it performs canonicalization on the key strings.
SetHeaders
method to Client
rpc/http.go
Outdated
// set headers | ||
hc.mu.Lock() | ||
for key, vals := range hc.headers { | ||
req.Header.Del(key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be missing something, but why do you have to delete the key before setting the key & Vals even though the request is a fresh new request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you're right, I got confused.
Resolves ethereum#20163 Co-authored-by: Felix Lange <fjl@twurst.com>
Resolves #20163