summaryrefslogtreecommitdiff
path: root/lib/https.js
diff options
context:
space:
mode:
authorPeter Marton <peter@risingstack.com>2017-10-19 20:16:02 +0200
committerRuben Bridgewater <ruben@bridgewater.de>2018-02-06 15:40:24 +0100
commita899576c977aef32d85074ac09d511e4590e28d7 (patch)
treeb065bf00d067a3816db31ce0ec88287be6d75afb /lib/https.js
parent82a73470506111ecc6361b9e0b0bb01f6377a531 (diff)
downloadandroid-node-v8-a899576c977aef32d85074ac09d511e4590e28d7.tar.gz
android-node-v8-a899576c977aef32d85074ac09d511e4590e28d7.tar.bz2
android-node-v8-a899576c977aef32d85074ac09d511e4590e28d7.zip
http: add options to http.createServer()
This adds the optional options argument to `http.createServer()`. It contains two options: the `IncomingMessage` and `ServerReponse` option. PR-URL: https://github.com/nodejs/node/pull/15752 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com>
Diffstat (limited to 'lib/https.js')
-rw-r--r--lib/https.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/https.js b/lib/https.js
index 5013791fe2..741ce84d2f 100644
--- a/lib/https.js
+++ b/lib/https.js
@@ -36,6 +36,9 @@ const { inherits } = util;
const debug = util.debuglog('https');
const { urlToOptions, searchParamsSymbol } = require('internal/url');
const errors = require('internal/errors');
+const { IncomingMessage, ServerResponse } = require('http');
+const { kIncomingMessage } = require('_http_common');
+const { kServerResponse } = require('_http_server');
function Server(opts, requestListener) {
if (!(this instanceof Server)) return new Server(opts, requestListener);
@@ -57,6 +60,9 @@ function Server(opts, requestListener) {
opts.ALPNProtocols = ['http/1.1'];
}
+ this[kIncomingMessage] = opts.IncomingMessage || IncomingMessage;
+ this[kServerResponse] = opts.ServerResponse || ServerResponse;
+
tls.Server.call(this, opts, _connectionListener);
this.httpAllowHalfOpen = false;