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

Empty response body (3-rd argument) must be passed to callback as an empty string #490

Merged
merged 1 commit into from
Mar 25, 2013

Conversation

Olegas
Copy link
Contributor

@Olegas Olegas commented Mar 25, 2013

Docs sates: "The callback argument gets 3 arguments. ... The third is the response body String or Buffer."
If response has an empty body (Content-length is 0) third argument is undefined, not String nor Buffer.

The "edge case" is JSON response. Empty body can't be parsed to something convinient, so, this case still results in undefined (may be it must be handled different way?).

mikeal added a commit that referenced this pull request Mar 25, 2013
Empty response body (3-rd argument) must be passed to callback as an empty string
@mikeal mikeal merged commit 9e1a5dc into request:master Mar 25, 2013
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