diff --git a/index.js b/index.js index f0f25c2..747063d 100644 --- a/index.js +++ b/index.js @@ -333,6 +333,9 @@ function setDefaults(defs) { return; } + if (opts.debug) { + console.debug(finalOpts); + } req = requester.request(finalOpts, onResponse); req.on('error', cb); @@ -410,7 +413,7 @@ function setDefaults(defs) { if ( opts.body || - 'string' === typeof opts.json || + (opts.json && true !== opts.json) || opts.form || opts.formData ) { @@ -434,6 +437,9 @@ function setDefaults(defs) { } } + if (opts.debug) { + reqOpts.debug = opts.debug; + } return urequestHelper(reqOpts, cb); } diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..68d2a83 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,5 @@ +{ + "name": "@root/request", + "version": "1.3.12", + "lockfileVersion": 1 +} diff --git a/package.json b/package.json index 2567ada..ddac586 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@root/request", - "version": "1.3.11", + "version": "1.3.12", "description": "A lightweight, zero-dependency drop-in replacement for request", "main": "index.js", "files": [