FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Ignore the case when getting a response header by emelois · Pull Request #2250 · NativeScript/NativeScript · GitHub

Ignore the case when getting a response header - #2250

Merged
hshristov merged 1 commit into
NativeScript:masterfrom
emelois:emelois/response-headers-case-insensitive
Jun 20, 2016
Merged

hshristov merged 1 commit into
NativeScript:masterfrom
emelois:emelois/response-headers-case-insensitive

Conversation

emelois commented Jun 6, 2016

Copy link
Copy Markdown
Contributor

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.

ns-bot commented Jun 6, 2016

Copy link
Copy Markdown

Can one of the admins verify this patch?

4 similar comments

ns-bot commented Jun 6, 2016

Copy link
Copy Markdown

Can one of the admins verify this patch?

ns-bot commented Jun 6, 2016

Copy link
Copy Markdown

Can one of the admins verify this patch?

ns-bot commented Jun 6, 2016

Copy link
Copy Markdown

Can one of the admins verify this patch?

ns-bot commented Jun 6, 2016

Copy link
Copy Markdown

Can one of the admins verify this patch?

ns-bot added the cla: yes label Jun 6, 2016
Comment thread tns-core-modules/xhr/xhr.ts Outdated
) {
return this._headers[header];
for (var i in this._headers) {
if (i.toLowerCase() === header.toLowerCase()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

You could cache the call to header.toLowerCase() instead of make it always.

Copy link
Copy Markdown
Contributor

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.
emelois force-pushed the emelois/response-headers-case-insensitive branch from 37e6e3d to c997427 Compare June 17, 2016 07:57

emelois commented Jun 17, 2016

Copy link
Copy Markdown
Contributor Author

@hshristov I cached the lowercase header and added a unit test.

vchimev commented Jun 20, 2016

Copy link
Copy Markdown
Contributor

run ci

hshristov merged commit 6282bae into NativeScript:master Jun 20, 2016

Copy link
Copy Markdown
Contributor

@emelois Thank you for your contribution. PR will be live with the next official release - 2.1.0

lock Bot commented Aug 28, 2019

Copy link
Copy Markdown

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.

lock Bot locked and limited conversation to collaborators Aug 28, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL