fix: Revert "feat(proxy): proxy environment variables available in lowercase for child processes. (#9978)"

This reverts commit 2d9734c3da.
This commit is contained in:
Rhys Arkins 2021-05-14 19:37:02 +02:00
parent af39170fc8
commit 1edcf5fc15
3 changed files with 0 additions and 33 deletions

View file

@ -7,9 +7,7 @@ describe('proxy', () => {
beforeEach(() => { beforeEach(() => {
delete process.env.HTTP_PROXY; delete process.env.HTTP_PROXY;
delete process.env.http_proxy;
delete process.env.HTTPS_PROXY; delete process.env.HTTPS_PROXY;
delete process.env.https_proxy;
delete process.env.NO_PROXY; delete process.env.NO_PROXY;
delete process.env.no_proxy; delete process.env.no_proxy;
}); });
@ -19,35 +17,11 @@ describe('proxy', () => {
bootstrap(); bootstrap();
expect(hasProxy()).toBeTrue(); expect(hasProxy()).toBeTrue();
}); });
it('copies upper case HTTP_PROXY to http_proxy', () => {
process.env.HTTP_PROXY = httpProxy;
bootstrap();
expect(hasProxy()).toBeTrue();
expect(process.env.HTTP_PROXY).toBeDefined();
expect(process.env.http_proxy).toBeDefined();
expect(process.env.HTTPS_PROXY).toBeUndefined();
expect(process.env.https_proxy).toBeUndefined();
expect(process.env.NO_PROXY).toBeUndefined();
expect(process.env.no_proxy).toBeUndefined();
});
it('respects HTTPS_PROXY', () => { it('respects HTTPS_PROXY', () => {
process.env.HTTPS_PROXY = httpsProxy; process.env.HTTPS_PROXY = httpsProxy;
bootstrap(); bootstrap();
expect(hasProxy()).toBeTrue(); expect(hasProxy()).toBeTrue();
}); });
it('copies upper case HTTPS_PROXY to https_proxy', () => {
process.env.HTTPS_PROXY = httpsProxy;
bootstrap();
expect(hasProxy()).toBeTrue();
expect(process.env.HTTPS_PROXY).toBeDefined();
expect(process.env.https_proxy).toBeDefined();
expect(process.env.HTTP_PROXY).toBeUndefined();
expect(process.env.http_proxy).toBeUndefined();
expect(process.env.NO_PROXY).toBeUndefined();
expect(process.env.no_proxy).toBeUndefined();
});
it('does nothing', () => { it('does nothing', () => {
process.env.no_proxy = noProxy; process.env.no_proxy = noProxy;
bootstrap(); bootstrap();

View file

@ -14,10 +14,6 @@ export function bootstrap(): void {
) { ) {
process.env[envVar] = process.env[envVar.toLowerCase()]; process.env[envVar] = process.env[envVar.toLowerCase()];
} }
if (process.env[envVar]) {
process.env[envVar.toLowerCase()] = process.env[envVar];
}
}); });
if ( if (

View file

@ -4,9 +4,6 @@ const basicEnvVars = [
'HTTP_PROXY', 'HTTP_PROXY',
'HTTPS_PROXY', 'HTTPS_PROXY',
'NO_PROXY', 'NO_PROXY',
'http_proxy',
'https_proxy',
'no_proxy',
'HOME', 'HOME',
'PATH', 'PATH',
'LC_ALL', 'LC_ALL',