8000 api: respect `HTTP(S)_PROXY` environment variable by msanft · Pull Request #2635 · edgelesssys/constellation · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

api: respect HTTP(S)_PROXY environment variable #2635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 23, 2023

Conversation

msanft
Copy link
Contributor
@msanft msanft commented Nov 23, 2023

Context

We create a custom *http.Transport, which, per default, uses a nil proxy (i.e. no proxy). In contrast to the http.DefaultClient, which uses the http.ProxyFromEnvironment proxy. Therefore, it does not respect the HTTP_PROXY and HTTPS_PROXY environment variables, as seen in #2634.

Proposed change(s)

  • Set the proxy to http.ProxyFromEnvironment.

Additional Information

The fix can be verified by setting HTTPS_PROXY=http://8.8.8.8 or something else which does not proxy. Then, navigate to a directory with a Constellation workspace, and executing bazel run //hack/image-fetch. Prior to this change, this would run normally as the traffic is not routed through the proxy. With the change, it will timeout as 8.8.8.8 does not proxy.

Checklist

  • Add labels (e.g., for changelog category)
  • Is PR title adequate for changelog?
  • Link to Milestone

Signed-off-by: Moritz Sanft <58110325+msanft@users.noreply.github.com>
@msanft msanft added the bug fix Fixing a bug label Nov 23, 2023
@msanft msanft added this to the v2.14.0 milestone Nov 23, 2023
@msanft msanft requested a review from daniel-weisse November 23, 2023 09:17
@msanft msanft requested a review from derpsteb as a code owner November 23, 2023 09:17
Copy link
netlify bot commented Nov 23, 2023

Deploy Preview for constellation-docs canceled.

Name Link
🔨 Latest commit 2326a97
🔍 Latest deploy log https://app.netlify.com/sites/constellation-docs/deploys/655f18940330ce0008acde7f

Copy link
Contributor

Coverage report

Package Old New Trend
internal/api/fetcher [no test files] [no test files] 🚧

@msanft msanft merged commit c922864 into main Nov 23, 2023
@msanft msanft deleted the fix/api/imagefetcher-use-proxy branch November 23, 2023 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix Fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0