Skip to content

fix: infinite proxy loop #4676

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
Jan 4, 2022
Merged

Conversation

code-asher
Copy link
Member

@code-asher code-asher commented Jan 3, 2022

I think the problem is that when a proxy is not in use proxy-agent
returns the global agent...which is itself since we set it globally,
causing the loop.

VS Code already covers proxies meaning we only need to do it in our own
requests so to fix this pass in the agent in the version fetch request
instead of overidding globally.

Also avoid proxy-from-env and pass in the proxy URI instead as both
http_proxy and https_proxy can be used for either http or https requests
but it does not allow that.

@code-asher code-asher requested a review from a team January 3, 2022 23:28
I think the problem is that when a proxy is not in use proxy-agent
returns the global agent...which is itself since we set it globally,
causing the loop.

VS Code already covers proxies meaning we only need to do it in our own
requests so to fix this pass in the agent in the version fetch request
instead of overidding globally.

Also avoid proxy-from-env and pass in the proxy URI instead as both
http_proxy and https_proxy can be used for either http or https requests
but it does not allow that.
@code-asher code-asher changed the title Fix infinite proxy loop fix: infinite proxy loop Jan 3, 2022
@codecov
Copy link

codecov bot commented Jan 3, 2022

Codecov Report

Merging #4676 (4c4b584) into main (47f0b6f) will increase coverage by 0.22%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4676      +/-   ##
==========================================
+ Coverage   68.88%   69.10%   +0.22%     
==========================================
  Files          30       29       -1     
  Lines        1655     1638      -17     
  Branches      341      341              
==========================================
- Hits         1140     1132       -8     
+ Misses        438      430       -8     
+ Partials       77       76       -1     
Impacted Files Coverage Δ
src/node/entry.ts 0.00% <ø> (ø)
src/node/constants.ts 100.00% <100.00%> (ø)
src/node/update.ts 86.95% <100.00%> (+0.59%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 47f0b6f...4c4b584. Read the comment docs.

Copy link
Contributor

@jsjoeio jsjoeio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK to me! 👍

@code-asher code-asher merged commit 0034808 into coder:main Jan 4, 2022
@code-asher code-asher deleted the infinite-proxy branch January 4, 2022 00:19
@jsjoeio jsjoeio added this to the 4.0.1 milestone Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants