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

merged 1 commit into from Mar 25, 2013


None yet

2 participants

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 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