v1.3.7: agent passthru (also timeout, setHost, createConnection, family, host, localAddress)

This commit is contained in:
AJ ONeal 2019-02-26 01:02:37 -07:00
父節點 4eaf68966c
當前提交 aec78877cf
共有 2 個檔案被更改,包括 11 行新增1 行删除

查看文件

@ -188,6 +188,16 @@ function setDefaults(defs) {
Object.keys(opts.uri).forEach(function (key) {
finalOpts[key] = opts.uri[key];
});
// A bug should be raised if request does it differently,
// but I think we're supposed to pass all acceptable options
// on to the raw http request
[ 'family', 'host', 'localAddress', 'agent', 'createConnection'
, 'timeout', 'setHost'
].forEach(function (key) {
finalOpts[key] = opts.uri[key];
});
finalOpts.method = opts.method;
finalOpts.headers = JSON.parse(JSON.stringify(opts.headers));
if (_body) {

查看文件

@ -1,6 +1,6 @@
{
"name": "@coolaj86/urequest",
"version": "1.3.6",
"version": "1.3.7",
"description": "A lightweight drop-in replacement for request",
"main": "index.js",
"files": [