http,https: align server option of https with http

Fixes: https://github.com/nodejs/node/issues/38954

PR-URL: https://github.com/nodejs/node/pull/38992
Refs: https://github.com/nodejs/node/pull/30570
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
Qingyu Deng authored and Michaël Zasso committed 2021-07-11 09:43:51 +02:00
1 parent ea8d83bf59
commit 35331cbd13
4 files changed
+268 -18

No files matched your search

+2 -6
View File
@@ -40,16 +40,14 @@ const tls = require('tls');
const { Agent: HttpAgent } = require('_http_agent');
const {
Server: HttpServer,
storeHTTPOptions,
_connectionListener,
kServerResponse
} = require('_http_server');
const { ClientRequest } = require('_http_client');
let debug = require('internal/util/debuglog').debuglog('https', (fn) => {
debug = fn;
});
const { URL, urlToHttpOptions, searchParamsSymbol } = require('internal/url');
const { IncomingMessage, ServerResponse } = require('http');
const { kIncomingMessage } = require('_http_common');
function Server(opts, requestListener) {
if (!(this instanceof Server)) return new Server(opts, requestListener);
@@ -67,9 +65,7 @@ function Server(opts, requestListener) {
opts.ALPNProtocols = ['http/1.1'];
}
this[kIncomingMessage] = opts.IncomingMessage || IncomingMessage;
this[kServerResponse] = opts.ServerResponse || ServerResponse;
FunctionPrototypeCall(storeHTTPOptions, this, opts);
FunctionPrototypeCall(tls.Server, this, opts, _connectionListener);
this.httpAllowHalfOpen = false;