diff options
author | Fedor Indutny <fedor.indutny@gmail.com> | 2012-07-11 23:53:27 +0400 |
---|---|---|
committer | Fedor Indutny <fedor.indutny@gmail.com> | 2012-07-20 01:49:30 +0400 |
commit | 53716eb0b5338999761d115fad9d392077836e63 (patch) | |
tree | e726a89f587c7ce676d4b9d81282e35d73540cf7 /lib/https.js | |
parent | 1fa0bca2ad58ad1d91557f8ae7f467370c0290d6 (diff) | |
download | android-node-v8-53716eb0b5338999761d115fad9d392077836e63.tar.gz android-node-v8-53716eb0b5338999761d115fad9d392077836e63.tar.bz2 android-node-v8-53716eb0b5338999761d115fad9d392077836e63.zip |
http/https: pass request to .createConnection()
It's useful for passing some additional options of request object to the
underlying API
Diffstat (limited to 'lib/https.js')
-rw-r--r-- | lib/https.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/https.js b/lib/https.js index 9778354007..ce431a127a 100644 --- a/lib/https.js +++ b/lib/https.js @@ -21,7 +21,8 @@ var tls = require('tls'); var http = require('http'); -var inherits = require('util').inherits; +var util = require('util'); +var inherits = util.inherits; function Server(opts, requestListener) { if (!(this instanceof Server)) return new Server(opts, requestListener); @@ -52,15 +53,15 @@ exports.createServer = function(opts, requestListener) { // HTTPS agents. function createConnection(/* [port, host, options] */) { - var options = {}; + var options = util._extend({}, this.options); if (typeof arguments[0] === 'object') { - options = arguments[0]; + options = util._extend(options, arguments[0]); } else if (typeof arguments[1] === 'object') { - options = arguments[1]; + options = util._extend(options, arguments[1]); options.port = arguments[0]; } else if (typeof arguments[2] === 'object') { - options = arguments[2]; + options = util._extend(options, arguments[2]); options.port = arguments[0]; options.host = arguments[1]; } else { |