-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix(core): headers set by the sdk must respect case insensitive keys #627
Conversation
Codecov Report
@@ Coverage Diff @@
## master #627 +/- ##
==========================================
- Coverage 77.15% 75.76% -1.39%
==========================================
Files 87 90 +3
Lines 2779 3202 +423
Branches 390 443 +53
==========================================
+ Hits 2144 2426 +282
- Misses 599 776 +177
+ Partials 36 0 -36
|
Does this change cause all header names to be lowercased, regardless of what case the users provide them in? If so, I'm not sure it's a good idea. The ideal implementation would be case-insensitive, but case-preserving at the same time. Meaning that comparisons would be case-insensitive, but the original casing that the user provided the header names in, would be preserved. |
I do see that debugging may be more difficult if the user input is transformed. I updated the code 👍 |
I noticed that the "Accept" field is added when it is not already present in the request header. However, the check is case sensitive, while the http RFC states that the http header are case insensitive.
This causes the
application/json
to be added when a user specifyaccept
and notAccept
:The above test will fail as the accept header contains both
image/png
andapplication/json
.