diff --git a/cli/lib/exec/spawn.js b/cli/lib/exec/spawn.js index d0142989ca..b818407e68 100644 --- a/cli/lib/exec/spawn.js +++ b/cli/lib/exec/spawn.js @@ -75,12 +75,6 @@ module.exports = { const overrides = util.getEnvOverrides() const node11WindowsFix = isPlatform('win32') - const proxySource = util.loadSystemProxySettings() - - if (proxySource) { - args.push(`--proxy-source="${proxySource}"`) - } - debug('spawning Cypress with executable: %s', executable) debug('spawn forcing env overrides %o', overrides) debug('spawn args %o %o', args, _.omit(options, 'env')) diff --git a/cli/lib/tasks/download.js b/cli/lib/tasks/download.js index a7773cebfe..1664d0c703 100644 --- a/cli/lib/tasks/download.js +++ b/cli/lib/tasks/download.js @@ -150,8 +150,6 @@ const start = ({ version, downloadDestination, progress }) => { } } } - util.loadSystemProxySettings() - const url = getUrl(version) progress.throttle = 100 diff --git a/cli/lib/util.js b/cli/lib/util.js index 1c305cdd11..488e7b1204 100644 --- a/cli/lib/util.js +++ b/cli/lib/util.js @@ -9,7 +9,6 @@ const getos = require('getos') const chalk = require('chalk') const Promise = require('bluebird') const cachedir = require('cachedir') -const getWindowsProxy = require('@cypress/get-windows-proxy') const executable = require('executable') const supportsColor = require('supports-color') const isInstalledGlobally = require('is-installed-globally') @@ -89,30 +88,6 @@ const util = { } }, - _getWindowsProxy () { - return getWindowsProxy() - }, - - loadSystemProxySettings () { - // load user's OS-specific proxy settings in to environment vars - if (!_.isUndefined(process.env.HTTP_PROXY) || !_.isUndefined(process.env.http_proxy)) { - // user has set proxy explicitly in environment vars, don't mess with it - return - } - - if (os.platform() === 'win32') { - const proxy = this._getWindowsProxy() - - if (proxy) { - // environment variables are the only way to make request lib use NO_PROXY - process.env.HTTP_PROXY = process.env.HTTPS_PROXY = proxy.httpProxy - process.env.NO_PROXY = process.env.NO_PROXY || proxy.noProxy - } - - return 'win32' - } - }, - isTty (fd) { return tty.isatty(fd) }, diff --git a/cli/package.json b/cli/package.json index 62cb668a35..5e58762b00 100644 --- a/cli/package.json +++ b/cli/package.json @@ -39,7 +39,6 @@ }, "types": "types", "dependencies": { - "@cypress/get-windows-proxy": "1.5.4", "@cypress/listr-verbose-renderer": "0.4.1", "@cypress/xvfb": "1.2.4", "bluebird": "3.5.0", diff --git a/cli/test/lib/exec/spawn_spec.js b/cli/test/lib/exec/spawn_spec.js index 90d3556a4d..c0cb8d6e1d 100644 --- a/cli/test/lib/exec/spawn_spec.js +++ b/cli/test/lib/exec/spawn_spec.js @@ -133,41 +133,6 @@ describe('lib/exec/spawn', function () { }) }) - context('proxy', function () { - beforeEach(function () { - this.oldEnv = Object.assign({}, process.env) - process.env.HTTP_PROXY = process.env.HTTPS_PROXY = process.env.NO_PROXY = undefined - }) - - it('loads proxy settings from Windows registry', function () { - this.spawnedProcess.on.withArgs('close').yieldsAsync(0) - os.platform.returns('win32') - sinon.stub(util, '_getWindowsProxy').returns({ - httpProxy: 'http://foo-bar.baz', - noProxy: 'a,b,c', - }) - - return spawn.start([], {}) - .then(() => { - return expect(cp.spawn).to.be.calledWithMatch('/path/to/cypress', [ - '--cwd', - cwd, - '--proxy-source="win32"', - ], { - env: { - 'HTTP_PROXY': 'http://foo-bar.baz', - 'HTTPS_PROXY': 'http://foo-bar.baz', - 'NO_PROXY': 'a,b,c', - }, - }) - }) - }) - - afterEach(function () { - Object.assign(process.env, this.oldEnv) - }) - }) - it('unrefs if options.detached is true', function () { this.spawnedProcess.on.withArgs('close').yieldsAsync(0) diff --git a/cli/test/lib/tasks/download_spec.js b/cli/test/lib/tasks/download_spec.js index a21fbd554d..4c41257452 100644 --- a/cli/test/lib/tasks/download_spec.js +++ b/cli/test/lib/tasks/download_spec.js @@ -203,15 +203,4 @@ describe('lib/tasks/download', function () { return snapshot('download status errors 1', normalize(ctx.stdout.toString())) }) }) - - it('calls loadSystemProxySettings before downloading', function () { - sinon.stub(fs, 'ensureDirAsync').rejects({ type: 'FAKE_ERR' }) - sinon.spy(util, 'loadSystemProxySettings') - - return download.start(this.options) - .catch(() => {}) - .finally(() => { - expect(util.loadSystemProxySettings).to.be.calledOnce - }) - }) })