Hello, I have an endpoint that may return binary data which is not an image or a video. The response headers include the correct content type, audio/aac for example, and the correct content-length header. However, when the response is received by the client, the response body is empty, and instead response.txt contains the returned data. I've tracked it down to this code block in Request.prototype._end(). https://github.com/visionmedia/superagent/blob/84206c75214e20bbc688d0645880696ecd773c27/src/node/index.js#L1082-L1084
It is unclear to me why the parser would necessarily be text in this case. I find that by changing this so that the fallback always uses exports.parse.image, my use case succeeds but results in 9 failed tests.
I am using superagent via visionmedia/supertest, in case that makes a difference.
Hello, I have an endpoint that may return binary data which is not an image or a video. The response headers include the correct content type,
audio/aac
for example, and the correctcontent-length
header. However, when the response is received by the client, the response body is empty, and insteadresponse.txt
contains the returned data. I've tracked it down to this code block inRequest.prototype._end()
. https://github.com/visionmedia/superagent/blob/84206c75214e20bbc688d0645880696ecd773c27/src/node/index.js#L1082-L1084It is unclear to me why the parser would necessarily be text in this case. I find that by changing this so that the fallback always uses
exports.parse.image
, my use case succeeds but results in 9 failed tests.I am using superagent via visionmedia/supertest, in case that makes a difference.