Skip to content

Commit

Permalink
Prefer forwarding lowercased ENV vars to proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Landon Grindheim authored and GitHub committed May 3, 2022
1 parent 895a5b2 commit 7cf8e5c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion __tests__/proxy-integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ integration('ProxyBuilder', () => {
await proxy.container.start()

const id = proxy.container.id
const proc = spawnSync('docker', ['exec', id, 'printenv', 'HTTP_PROXY'])
const proc = spawnSync('docker', ['exec', id, 'printenv', 'http_proxy'])
const output = proc.stdout.toString()
expect(output).toEqual('HTTP_PROXY')
})
Expand Down
9 changes: 3 additions & 6 deletions dist/main/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/main/index.js.map

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions src/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,9 @@ export class ProxyBuilder {
AttachStdout: true,
AttachStderr: true,
Env: [
`http_proxy=${process.env.http_proxy}`,
`HTTP_PROXY=${process.env.HTTP_PROXY}`,
`https_proxy=${process.env.https_proxy}`,
`HTTPS_PROXY=${process.env.HTTPS_PROXY}`,
`no_proxy=${process.env.no_proxy}`,
`NO_PROXY=${process.env.NO_PROXY}`,
`http_proxy=${process.env.http_proxy || process.env.HTTP_PROXY}`,
`https_proxy=${process.env.https_proxy || process.env.HTTPS_PROXY}`,
`no_proxy=${process.env.no_proxy || process.env.NO_PROXY}`,
`JOB_ID=${jobId}`
],
Entrypoint: [
Expand Down

0 comments on commit 7cf8e5c

Please sign in to comment.