From 3b2951a3ba1521b9866d9b33960aa3307d4f31dd Mon Sep 17 00:00:00 2001 From: Gar Date: Wed, 11 Dec 2024 15:16:09 -0800 Subject: [PATCH] deps: https-proxy-agent@7.0.6 --- node_modules/https-proxy-agent/dist/index.js | 21 ++++++++++++-------- node_modules/https-proxy-agent/package.json | 4 ++-- package-lock.json | 8 ++++---- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/node_modules/https-proxy-agent/dist/index.js b/node_modules/https-proxy-agent/dist/index.js index 0c91722035f07..1857f464724e2 100644 --- a/node_modules/https-proxy-agent/dist/index.js +++ b/node_modules/https-proxy-agent/dist/index.js @@ -35,6 +35,17 @@ const agent_base_1 = require("agent-base"); const url_1 = require("url"); const parse_proxy_response_1 = require("./parse-proxy-response"); const debug = (0, debug_1.default)('https-proxy-agent'); +const setServernameFromNonIpHost = (options) => { + if (options.servername === undefined && + options.host && + !net.isIP(options.host)) { + return { + ...options, + servername: options.host, + }; + } + return options; +}; /** * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests. @@ -82,11 +93,7 @@ class HttpsProxyAgent extends agent_base_1.Agent { let socket; if (proxy.protocol === 'https:') { debug('Creating `tls.Socket`: %o', this.connectOpts); - const servername = this.connectOpts.servername || this.connectOpts.host; - socket = tls.connect({ - ...this.connectOpts, - servername, - }); + socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); } else { debug('Creating `net.Socket`: %o', this.connectOpts); @@ -122,11 +129,9 @@ class HttpsProxyAgent extends agent_base_1.Agent { // The proxy is connecting to a TLS server, so upgrade // this socket connection to a TLS connection. debug('Upgrading socket connection to TLS'); - const servername = opts.servername || opts.host; return tls.connect({ - ...omit(opts, 'host', 'path', 'port'), + ...omit(setServernameFromNonIpHost(opts), 'host', 'path', 'port'), socket, - servername, }); } return socket; diff --git a/node_modules/https-proxy-agent/package.json b/node_modules/https-proxy-agent/package.json index 3c793b769dc5d..51b7e1175ff51 100644 --- a/node_modules/https-proxy-agent/package.json +++ b/node_modules/https-proxy-agent/package.json @@ -1,6 +1,6 @@ { "name": "https-proxy-agent", - "version": "7.0.5", + "version": "7.0.6", "description": "An HTTP(s) proxy `http.Agent` implementation for HTTPS", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -21,7 +21,7 @@ "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "4" }, "devDependencies": { diff --git a/package-lock.json b/package-lock.json index 263034ec9ce07..d8e943bfe823d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9095,13 +9095,13 @@ } }, "node_modules/https-proxy-agent": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", - "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "inBundle": true, "license": "MIT", "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.2", "debug": "4" }, "engines": {