From cd3a9eebca8d4914d1599855d813ea68ed3135cc Mon Sep 17 00:00:00 2001 From: dnlup Date: Tue, 19 Mar 2019 11:24:30 +0100 Subject: [PATCH] https: remove usage of public require('util') Use `require('internal/util/debuglog').debuglog` and `Object.setPrototypeOf` instead of `require('util').debuglog` and `require('util').inherits`. Refs: https://github.com/nodejs/node/issues/26546 PR-URL: https://github.com/nodejs/node/pull/26772 Reviewed-By: Ruben Bridgewater Reviewed-By: Yongsheng Zhang Reviewed-By: James M Snell --- lib/https.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/https.js b/lib/https.js index 041bd41edde5ec..715f86878ae99b 100644 --- a/lib/https.js +++ b/lib/https.js @@ -25,7 +25,6 @@ require('internal/util').assertCrypto(); const tls = require('tls'); const url = require('url'); -const util = require('util'); const { Agent: HttpAgent } = require('_http_agent'); const { Server: HttpServer, @@ -33,8 +32,7 @@ const { kServerResponse } = require('_http_server'); const { ClientRequest } = require('_http_client'); -const { inherits } = util; -const debug = util.debuglog('https'); +const debug = require('internal/util/debuglog').debuglog('https'); const { URL, urlToOptions, searchParamsSymbol } = require('internal/url'); const { IncomingMessage, ServerResponse } = require('http'); const { kIncomingMessage } = require('_http_common'); @@ -76,7 +74,8 @@ function Server(opts, requestListener) { this.maxHeadersCount = null; this.headersTimeout = 40 * 1000; // 40 seconds } -inherits(Server, tls.Server); +Object.setPrototypeOf(Server.prototype, tls.Server.prototype); +Object.setPrototypeOf(Server, tls.Server); Server.prototype.setTimeout = HttpServer.prototype.setTimeout;