diff --git a/types/node/index.d.ts b/types/node/index.d.ts index f484e48703..2c49c33cc4 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -1194,6 +1194,7 @@ declare module "http" { agent?: Agent | boolean; _defaultAgent?: Agent; timeout?: number; + setHost?: boolean; // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278 createConnection?: (options: ClientRequestArgs, oncreate: (err: Error, socket: net.Socket) => void) => net.Socket; } diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index e2e24dad68..7dd4b0c633 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -1940,6 +1940,7 @@ async function asyncStreamPipelineFinished() { let req: http.ClientRequest = new http.ClientRequest("https://www.google.com"); req = new http.ClientRequest(new url.URL("https://www.google.com")); req = new http.ClientRequest({ path: 'http://0.0.0.0' }); + req = new http.ClientRequest({ setHost: false }); // header req.setHeader('Content-Type', 'text/plain');