-
-
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
Case insensitive handling of headers #1291
Conversation
Just realized that a lot of people are modifying In this case above PR won't fix the issue to full extent, result sent by adapters make result won't be fully predictable IMHO modification of configuration (headers in particular) by reference doesn't seem right. Better place may be But pure functions look like a cleaner approach -- do not allow to mutate anything, require always to produce new object in interceptors, transformers and freeze defaults in DEV mode |
@betalb I think the same about cleaner approach, but some people (as with the rest you wrote) needs modify |
2760755
to
48a7902
Compare
I'm not a huge fan of introducing a new class for this purpose, it seems too bloaty for the codebase. I think it would be best to convert all header names to lowercase at all times, which would remove the need for any special logic related to this. |
I'm not closely following current development effort, but remember that there was talk about reworking way how configuration is done. Especially default configuration. I.e. at the time of writhing, there was a way to directly mutate default headers, inherited by all instances that means by the time we receive headers in adapter we already may have ambiguity. Note that my PR also doesn't address this issue |
The config situation was addressed a while ago (#1395) and it shouldn't be possible to mutate defaults to instances after they have been set. However, you make a good point which I did not initially consider. |
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 |
Fixes #1237
One breaking change was introduced to internal util merge method: it merges objects ignoring case of keys. This change is covered with tests to highlight new behaviour.
This was a trade-off to minimize impact on bundle size. Currently this method is used to merge configuration objects, so I don't see any issues with this change.