From 0777f969f7034f4f970d33303568c2150ce56e79 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Aug 2020 11:44:46 -0400 Subject: [PATCH 1/2] =?UTF-8?q?fix(deps):=20update=20dependency=20iconv-li?= =?UTF-8?q?te=20to=20version=200.6.2=20=F0=9F=8C=9F=20(#8387)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Renovate Bot --- packages/proxy/package.json | 2 +- yarn.lock | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/proxy/package.json b/packages/proxy/package.json index 56fc9bcffe16..72d8064dfcba 100644 --- a/packages/proxy/package.json +++ b/packages/proxy/package.json @@ -15,7 +15,7 @@ "common-tags": "1.8.0", "debug": "4.1.1", "grapheme-splitter": "1.0.4", - "iconv-lite": "0.5.0", + "iconv-lite": "0.6.2", "lodash": "4.17.19", "pumpify": "1.5.1", "through": "2.3.8", diff --git a/yarn.lock b/yarn.lock index 6aef2bd18927..c244ab11c0cc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14255,14 +14255,7 @@ iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@^0.4.5: dependencies: safer-buffer ">= 2.1.2 < 3" -iconv-lite@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.5.0.tgz#59cdde0a2a297cc2aeb0c6445a195ee89f127550" - integrity sha512-NnEhI9hIEKHOzJ4f697DMz9IQEXr/MMJ5w64vN2/4Ai+wRnvV7SBrL0KLoRlwaKVghOc7LQ5YkPLuX146b6Ydw== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -iconv-lite@^0.6.2: +iconv-lite@0.6.2, iconv-lite@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.2.tgz#ce13d1875b0c3a674bd6a04b7f76b01b1b6ded01" integrity sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ== From eac7859fccf1de06122f845fa55b70b51d1dc705 Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Tue, 25 Aug 2020 01:48:11 +0630 Subject: [PATCH 2/2] fix: NO_PROXY env var no longer be respected over npm_config_noproxy env var (#8295) Co-authored-by: Zach Bloomquist --- packages/https-proxy/package.json | 2 +- packages/https-proxy/test/integration/proxy_spec.js | 7 ++++++- packages/network/package.json | 2 +- packages/network/test/unit/agent_spec.ts | 5 +++++ packages/server/lib/util/proxy.ts | 2 +- yarn.lock | 7 ++++++- 6 files changed, 20 insertions(+), 5 deletions(-) diff --git a/packages/https-proxy/package.json b/packages/https-proxy/package.json index 1fe7859d38db..d1d28fb9f046 100644 --- a/packages/https-proxy/package.json +++ b/packages/https-proxy/package.json @@ -19,7 +19,7 @@ "fs-extra": "8.1.0", "lodash": "4.17.19", "node-forge": "0.9.0", - "proxy-from-env": "1.1.0", + "proxy-from-env": "1.0.0", "semaphore": "1.1.0" }, "devDependencies": { diff --git a/packages/https-proxy/test/integration/proxy_spec.js b/packages/https-proxy/test/integration/proxy_spec.js index 40d94aa47281..65ab9355eb9a 100644 --- a/packages/https-proxy/test/integration/proxy_spec.js +++ b/packages/https-proxy/test/integration/proxy_spec.js @@ -229,8 +229,13 @@ describe('Proxy', () => { context('with an upstream proxy', () => { beforeEach(function () { + // PROXY vars should override npm_config vars, so set them to cause failures if they are used + // @see https://github.com/cypress-io/cypress/pull/8295 + process.env.npm_config_proxy = process.env.npm_config_https_proxy = 'http://erroneously-used-npm-proxy.invalid' + process.env.npm_config_noproxy = 'just,some,nonsense' + process.env.NO_PROXY = '' - process.env.HTTP_PROXY = (process.env.HTTPS_PROXY = 'http://localhost:9001') + process.env.HTTP_PROXY = process.env.HTTPS_PROXY = 'http://localhost:9001' this.upstream = new DebugProxy({ keepRequests: true, diff --git a/packages/network/package.json b/packages/network/package.json index f31503436964..4ed36032fe73 100644 --- a/packages/network/package.json +++ b/packages/network/package.json @@ -18,7 +18,7 @@ "concat-stream": "1.6.2", "debug": "4.1.1", "lodash": "4.17.19", - "proxy-from-env": "1.1.0" + "proxy-from-env": "1.0.0" }, "devDependencies": { "@cypress/debugging-proxy": "2.0.1", diff --git a/packages/network/test/unit/agent_spec.ts b/packages/network/test/unit/agent_spec.ts index e049f7b1351e..2c955639dd16 100644 --- a/packages/network/test/unit/agent_spec.ts +++ b/packages/network/test/unit/agent_spec.ts @@ -74,6 +74,11 @@ describe('lib/agent', function () { context(testCase.name, function () { beforeEach(function () { if (testCase.proxyUrl) { + // PROXY vars should override npm_config vars, so set them to cause failures if they are used + // @see https://github.com/cypress-io/cypress/pull/8295 + process.env.npm_config_proxy = process.env.npm_config_https_proxy = 'http://erroneously-used-npm-proxy.invalid' + process.env.npm_config_noproxy = 'just,some,nonsense' + process.env.HTTP_PROXY = process.env.HTTPS_PROXY = testCase.proxyUrl process.env.NO_PROXY = '' } diff --git a/packages/server/lib/util/proxy.ts b/packages/server/lib/util/proxy.ts index eb8465dbf760..d0f57298f6fd 100644 --- a/packages/server/lib/util/proxy.ts +++ b/packages/server/lib/util/proxy.ts @@ -71,7 +71,7 @@ export const loadSystemProxySettings = () => { debug('found proxy environment variables %o', _.pick(process.env, [ 'NO_PROXY', 'HTTP_PROXY', 'HTTPS_PROXY', 'no_proxy', 'http_proxy', 'https_proxy', - 'npm_config_proxy', 'npm_config_https_proxy', + 'npm_config_proxy', 'npm_config_https_proxy', 'npm_config_noproxy', ])) ;['NO_PROXY', 'HTTP_PROXY', 'HTTPS_PROXY'].forEach(copyLowercaseEnvToUppercase) diff --git a/yarn.lock b/yarn.lock index c244ab11c0cc..e2bc1b32ccba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -20423,7 +20423,12 @@ proxy-addr@~2.0.5: forwarded "~0.1.2" ipaddr.js "1.9.1" -proxy-from-env@1.1.0, proxy-from-env@^1.0.0: +proxy-from-env@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee" + integrity sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4= + +proxy-from-env@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==