diff options
| author | dnlup <dwon.dnl@gmail.com> | 2019-03-19 11:24:30 +0100 |
|---|---|---|
| committer | Anto Aravinth <anto.aravinth.cse@gmail.com> | 2019-03-23 18:40:24 +0530 |
| commit | cd3a9eebca8d4914d1599855d813ea68ed3135cc (patch) | |
| tree | 9f84a807d7fe9f5d95877d682119fe46ce56f576 /lib/https.js | |
| parent | 0c89a21f96b43d1094e01f40e6d850155163127d (diff) | |
| download | node-new-cd3a9eebca8d4914d1599855d813ea68ed3135cc.tar.gz | |
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 <ruben@bridgewater.de>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/https.js')
| -rw-r--r-- | lib/https.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/https.js b/lib/https.js index 041bd41edd..715f86878a 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; |
