-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Ignore the case when getting a response header #2250
Ignore the case when getting a response header #2250
Conversation
Can one of the admins verify this patch? |
4 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
&& !this._errorFlag | ||
) { | ||
return this._headers[header]; | ||
for (var i in this._headers) { | ||
if (i.toLowerCase() === header.toLowerCase()) { |
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.
You could cache the call to header.toLowerCase()
instead of make it always.
Is it possible to add a unit-test? |
According to the RFC: https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 "Field names are case-insensitive". For instance, Google Cloud Endpoints use "content-type" in the response.
37e6e3d
to
c997427
Compare
@hshristov I cached the lowercase header and added a unit test. |
run ci |
@emelois Thank you for your contribution. PR will be live with the next official release - 2.1.0 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
According to the RFC: https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
"Field names are case-insensitive".
For instance, Google Cloud Endpoints use "content-type" in the response.