2
0
mirror of https://github.com/therootcompany/request.js synced 2025-02-22 05:48:05 +00:00

wrap onResponse for form-data's signature with error

This commit is contained in:
AJ ONeal 2018-07-07 14:30:58 -06:00
parent c355fb20c4
commit 739354090b

View File

@ -260,7 +260,11 @@ function setDefaults(defs) {
debug(formHeaders);
// generally uploads don't use Chunked Encoding (some systems have issues with it)
// and I don't want to do the work to calculate the content-lengths. This seems to work.
form.submit(finalOpts, onResponse);
form.submit(finalOpts, function (err, resp) {
if (err) { cb(err); }
onResponse(resp);
resp.resume();
});
//req = requester.request(finalOpts, onResponse);
//req.on('error', cb);
//form.pipe(req);