v1.3.12: bugfix json request
This commit is contained in:
parent
9ab91d9721
commit
1507b38503
8
index.js
8
index.js
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"name": "@root/request",
|
||||||
|
"version": "1.3.12",
|
||||||
|
"lockfileVersion": 1
|
||||||
|
}
|
|
@ -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": [
|
||||||
|
|
Loading…
Reference in New Issue