Skip to content
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

Failed to set Content-Type internally with the xhr's getResponseHeader #638

Closed
wants to merge 2 commits into from

Conversation

rpastorelle
Copy link

In response to an issue in which res.body is null ...superagent Failed to correctly set Content-Type header from the xhr with getResponseHeader due to case-sensitivity

@slooker
Copy link

slooker commented May 3, 2015

This solved the problem for me.

@defunctzombie
Copy link
Contributor

sounds like react-native is at fault here? headers are not case sensitive as far as I am aware

@slooker
Copy link

slooker commented May 3, 2015

I'm not sure if it's react-native's fault or not, but according to https://tools.ietf.org/html/rfc7230#appendix-A.2 section 3.2, headers definitely should be case-insensitive.

albertfdp added a commit to podio/podio-js that referenced this pull request May 4, 2015
@dhrrgn
Copy link

dhrrgn commented May 4, 2015

@slooker @defunctzombie It is true that getResponseHeader should be case-insensitive. However, this is probably an issue with JavascriptCore (which is the engine that ReactNative uses), thus cannot be fixed by the Facebook team (without an upstream fix). I think the best solution here is just to use the correct case (per the spec).

@defunctzombie
Copy link
Contributor

IMO the best solution is for the engine to the fixed. This has not been a
problem in any other browser to this point. If it was not in the spec I
might feel differently but given that all the other browsers behave
correctly I am hesitant to fix this since it seems like a bug in
JavascriptCore (not exactly sure what that is by sounds relatively new and
likely to fix this bug)

On Monday, May 4, 2015, Dan Horrigan notifications@github.com wrote:

@slooker https://github.com/slooker @defunctzombie
https://github.com/defunctzombie It is true that getResponseHeader
should be case-insensitive. However, this is probably an issue with
JavascriptCore (which is the engine that ReactNative uses), thus cannot be
fixed by the Facebook team (without an upstream fix). I think the best
solution here is just to use the correct case.


Reply to this email directly or view it on GitHub
#638 (comment)
.

@defunctzombie
Copy link
Contributor

I would at least file an issue there and see how receptive they are. If for
some reason they are not receptive then we can revisit.

On Monday, May 4, 2015, Dan Horrigan notifications@github.com wrote:

@slooker https://github.com/slooker @defunctzombie
https://github.com/defunctzombie It is true that getResponseHeader
should be case-insensitive. However, this is probably an issue with
JavascriptCore (which is the engine that ReactNative uses), thus cannot be
fixed by the Facebook team (without an upstream fix). I think the best
solution here is just to use the correct case.


Reply to this email directly or view it on GitHub
#638 (comment)
.

@slooker
Copy link

slooker commented May 4, 2015

I agree, we should absolutely post it as an issue there. Getting it fixed where it's actually broken is a better option than applying a bandaid further down.

Why not use the typical case for Content-Type header.
@rpastorelle
Copy link
Author

I don't see the harm in using the typical case for this header. It adds no extra code and still fixes the issue.

@rpastorelle
Copy link
Author

I found & fixed the root cause in React Native — facebook/react-native#1138

@rpastorelle rpastorelle closed this May 4, 2015
@defunctzombie
Copy link
Contributor

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants