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

Don't attempt to parse 204 & 205 #49

Merged
merged 1 commit into from
Mar 8, 2016
Merged

Don't attempt to parse 204 & 205 #49

merged 1 commit into from
Mar 8, 2016

Conversation

just-paja
Copy link
Contributor

res.json throws InternalError: "Unexpected end of input" if the response if blank.

Modified getJSON will skip parsing JSON response if the response status is either "No Content" or "Reset Content". Presence of Content-Type header does not imply presence of response body, therefore it is unsafe to rely on it.

Modified `getJSON` will skip parsing JSON response if the response status is either "No Content" or "Reset Content". Presence of `Content-Type` header does not imply presence of response body, therefore it is unsafe to rely on it.
@barrystaes
Copy link
Contributor

I cant release 1.0.0 on NPM because I dont have publish access, nor experience doing that. Depends on when @agraboso is able to do so..

@just-paja
Copy link
Contributor Author

Ok, we will just have to wait for him then. Thanks :)

barrystaes added a commit that referenced this pull request Mar 8, 2016
@barrystaes barrystaes merged commit dc33c7f into agraboso:master Mar 8, 2016
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.

None yet

2 participants