-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Headers should be compared with case ignored #1237
Comments
I've created potential fix, if it looks good, I can adopt to contributing guide, and create PR |
@betalb I would propose you submit your PR directly, as it's easier for the maintainers to notice it and potentially approve it. |
@betalb Please submit the PR, What you think about using a |
Will create PR shortly, need to write failing test first. @montogeek about map, we need case insensitive map in this case, which is not offered by ES spec. And I don't see how map will help here, IMHO it will just add more confusion. Even if we will be able to predict in which order keys will be iterated, it won't help library user a lot, as he will need to know how adapter is implemented (maybe adapter is sorting headers by key) and which default values are provided by axios. I was trying not to increase the size of library itself too much. Trade off was made and merge method became case-insesnistive merge (that also does whitespace trimming of keys), which should be OK for it's current use case. |
I've raised PR, anyone interested please review |
IMO the most straight-forward way would be to lowercase all header names (a) in defaults, and (b) when headers are passed to instance/request. Only dealing with lowercase header names would remove any fiddling around which case to check. |
Hi, Thank you for this pull request, this is a pretty stale pull request so I am going to close this in favour of #2880 as its a bit fresher and seems to solve the asme issue. If you feel it does not solve this issue please open an issue again. Thanks |
Summary
Headers provided in config are merged with defaults without checking for existing value that can be in different case
i.e. when doing below request we can't predict which value will be set from defaults
Accept
or from configaccept
Chrome will set
Accept
, which is not expectedContext
The text was updated successfully, but these errors were encountered: