diff --git a/index.js b/index.js index c4a71fd..d16ee40 100644 --- a/index.js +++ b/index.js @@ -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) { diff --git a/package.json b/package.json index 140ba1d..59b9b08 100644 --- a/package.json +++ b/package.json @@ -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": [