wrap onResponse for form-data's signature with error
This commit is contained in:
parent
c355fb20c4
commit
739354090b
6
index.js
6
index.js
|
@ -260,7 +260,11 @@ function setDefaults(defs) {
|
||||||
debug(formHeaders);
|
debug(formHeaders);
|
||||||
// generally uploads don't use Chunked Encoding (some systems have issues with it)
|
// 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.
|
// 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 = requester.request(finalOpts, onResponse);
|
||||||
//req.on('error', cb);
|
//req.on('error', cb);
|
||||||
//form.pipe(req);
|
//form.pipe(req);
|
||||||
|
|
Loading…
Reference in New Issue