v1.3.12: bugfix json request

This commit is contained in:
AJ ONeal 2019-10-29 14:42:26 -06:00
parent 9ab91d9721
commit 1507b38503
3 changed files with 13 additions and 2 deletions

View File

@ -333,6 +333,9 @@ function setDefaults(defs) {
return; return;
} }
if (opts.debug) {
console.debug(finalOpts);
}
req = requester.request(finalOpts, onResponse); req = requester.request(finalOpts, onResponse);
req.on('error', cb); req.on('error', cb);
@ -410,7 +413,7 @@ function setDefaults(defs) {
if ( if (
opts.body || opts.body ||
'string' === typeof opts.json || (opts.json && true !== opts.json) ||
opts.form || opts.form ||
opts.formData opts.formData
) { ) {
@ -434,6 +437,9 @@ function setDefaults(defs) {
} }
} }
if (opts.debug) {
reqOpts.debug = opts.debug;
}
return urequestHelper(reqOpts, cb); return urequestHelper(reqOpts, cb);
} }

5
package-lock.json generated Normal file
View File

@ -0,0 +1,5 @@
{
"name": "@root/request",
"version": "1.3.12",
"lockfileVersion": 1
}

View File

@ -1,6 +1,6 @@
{ {
"name": "@root/request", "name": "@root/request",
"version": "1.3.11", "version": "1.3.12",
"description": "A lightweight, zero-dependency drop-in replacement for request", "description": "A lightweight, zero-dependency drop-in replacement for request",
"main": "index.js", "main": "index.js",
"files": [ "files": [