You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is problematic because, per RFC2616, request headers are case-insensitive. The result is that header overrides are not respected and duplicate headers with the same field name (of mixed casing) but different values could be sent in the request.
For example:
needle.get('http://example.com', {headers: {'user-agent': 'not going to work'}})
will result in the following config.headers object:
Currently, when a request is setup and the default headers are merged into the request-specific ones, no normalization is being performed.
This is problematic because, per RFC2616, request headers are case-insensitive. The result is that header overrides are not respected and duplicate headers with the same field name (of mixed casing) but different values could be sent in the request.
For example:
will result in the following
config.headers
object:where the expected object would be:
I think the simplest solution would be to do the following:
move the header overrides down below the basic/digest auth section (ie: to ~ line 235) and ensure the header key is lowercased:
add the following directly above the overrides:
This tracks the current time complexity and ensures overrides are respected.
The text was updated successfully, but these errors were encountered: