Skip to content

Commit

Permalink
https: remove usage of public require('util')
Browse files Browse the repository at this point in the history
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 <ruben@bridgewater.de>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
dnlup authored and antsmartian committed Mar 23, 2019
1 parent 0c89a21 commit cd3a9ee
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/https.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@ 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,
_connectionListener,
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');
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit cd3a9ee

Please sign in to comment.