2
0
mirror of https://git.coolaj86.com/coolaj86/request.js synced 2025-04-21 14:50:37 +00:00

Compare commits

...

4 Commits

Author SHA1 Message Date
bb30d5acf6
1.8.2 2022-06-14 01:37:28 -06:00
5b539deb7b
fix: copy http options from opts (not opts.uri) 2022-06-14 01:24:50 -06:00
0a2e7afa76
1.8.1 2022-01-12 12:45:07 -07:00
ba60df7eab
fix: don't JSON.stringify a string body, duh 2022-01-12 12:42:34 -07:00
3 changed files with 6 additions and 4 deletions

View File

@ -280,7 +280,7 @@ function setDefaults(defs) {
var requester; var requester;
if (opts.body) { if (opts.body) {
if (true === opts.json) { if (true === opts.json && 'string' !== typeof opts.body) {
_body = JSON.stringify(opts.body); _body = JSON.stringify(opts.body);
} else { } else {
_body = opts.body; _body = opts.body;
@ -324,7 +324,9 @@ function setDefaults(defs) {
'timeout', 'timeout',
'setHost' 'setHost'
].forEach(function (key) { ].forEach(function (key) {
finalOpts[key] = opts.uri[key]; if (key in opts) {
finalOpts[key] = opts[key];
}
}); });
finalOpts.method = opts.method; finalOpts.method = opts.method;

2
package-lock.json generated
View File

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

View File

@ -1,6 +1,6 @@
{ {
"name": "@root/request", "name": "@root/request",
"version": "1.8.0", "version": "1.8.2",
"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": [