Skip to content

Commit cd3a9ee

Browse files
dnlupantsmartian
authored andcommitted
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: #26546 PR-URL: #26772 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 0c89a21 commit cd3a9ee

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/https.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,14 @@ require('internal/util').assertCrypto();
2525

2626
const tls = require('tls');
2727
const url = require('url');
28-
const util = require('util');
2928
const { Agent: HttpAgent } = require('_http_agent');
3029
const {
3130
Server: HttpServer,
3231
_connectionListener,
3332
kServerResponse
3433
} = require('_http_server');
3534
const { ClientRequest } = require('_http_client');
36-
const { inherits } = util;
37-
const debug = util.debuglog('https');
35+
const debug = require('internal/util/debuglog').debuglog('https');
3836
const { URL, urlToOptions, searchParamsSymbol } = require('internal/url');
3937
const { IncomingMessage, ServerResponse } = require('http');
4038
const { kIncomingMessage } = require('_http_common');
@@ -76,7 +74,8 @@ function Server(opts, requestListener) {
7674
this.maxHeadersCount = null;
7775
this.headersTimeout = 40 * 1000; // 40 seconds
7876
}
79-
inherits(Server, tls.Server);
77+
Object.setPrototypeOf(Server.prototype, tls.Server.prototype);
78+
Object.setPrototypeOf(Server, tls.Server);
8079

8180
Server.prototype.setTimeout = HttpServer.prototype.setTimeout;
8281

0 commit comments

Comments
 (0)