fix(env-http-proxy-agent): assume http for schema-less proxy env vars#4860
fix(env-http-proxy-agent): assume http for schema-less proxy env vars#4860nthbotast wants to merge 2 commits intonodejs:mainfrom
Conversation
| const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY | ||
| if (HTTPS_PROXY) { | ||
| this[kHttpsProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTPS_PROXY }) | ||
| this[kHttpsProxyAgent] = new ProxyAgent({ ...agentOpts, uri: normalizeProxyURI(HTTPS_PROXY) }) |
There was a problem hiding this comment.
What's the rationale of normalizing https to http?
unless tunneling, that can cause connect rejection from proxy.
|
Good question. The intent here is only to handle scheme-less values (e.g. I defaulted to That said, I agree ambiguity exists for scheme-less |
|
Let's do that. I can see a bit of ambiguity if I try to set a schema less origin |
|
Done 👍\n\nI pushed commit d023525 to apply the requested split behavior:\n- schemaless => \n- schemaless => \n\nI also updated the corresponding env-proxy test expectation to match.\n\nI couldn't run in this ephemeral checkout because test deps are not installed yet ( missing). |
|
Follow-up (my previous comment was mangled by shell escaping): I pushed commit d023525 to apply the requested split behavior:
I also updated the matching env-proxy test expectation. I couldn't run |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4860 +/- ##
=======================================
Coverage 93.13% 93.14%
=======================================
Files 109 109
Lines 34243 34258 +15
=======================================
+ Hits 31893 31909 +16
+ Misses 2350 2349 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
http://scheme whenHTTP_PROXY/HTTPS_PROXYvalues are provided without a URL schemeEnvHttpProxyAgenttestsTesting
Closes #4736