mirror of
https://git.coolaj86.com/coolaj86/request.js
synced 2025-04-21 14:50:37 +00:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
bb30d5acf6 | |||
5b539deb7b | |||
0a2e7afa76 | |||
ba60df7eab |
6
index.js
6
index.js
@ -280,7 +280,7 @@ function setDefaults(defs) {
|
||||
var requester;
|
||||
|
||||
if (opts.body) {
|
||||
if (true === opts.json) {
|
||||
if (true === opts.json && 'string' !== typeof opts.body) {
|
||||
_body = JSON.stringify(opts.body);
|
||||
} else {
|
||||
_body = opts.body;
|
||||
@ -324,7 +324,9 @@ function setDefaults(defs) {
|
||||
'timeout',
|
||||
'setHost'
|
||||
].forEach(function (key) {
|
||||
finalOpts[key] = opts.uri[key];
|
||||
if (key in opts) {
|
||||
finalOpts[key] = opts[key];
|
||||
}
|
||||
});
|
||||
|
||||
finalOpts.method = opts.method;
|
||||
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@root/request",
|
||||
"version": "1.8.0",
|
||||
"version": "1.8.2",
|
||||
"lockfileVersion": 1
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@root/request",
|
||||
"version": "1.8.0",
|
||||
"version": "1.8.2",
|
||||
"description": "A lightweight, zero-dependency drop-in replacement for request",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
|
Loading…
x
Reference in New Issue
Block a user