-
Notifications
You must be signed in to change notification settings - Fork 49.7k
fix the problem that axios don't use the http proxy #21199 #21649
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
base: master
Are you sure you want to change the base?
Conversation
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| port: parseInt(parsedUrl.port) || (parsedUrl.protocol === 'https:' ? 443 : 80), | ||
| protocol: parsedUrl.protocol.replace(':', ''), | ||
| }; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Proxy Architecture: Conflicting Configuration Logic
Setting axiosConfig.proxy from environment variables conflicts with the existing proxy handling mechanism. The codebase explicitly disables axios's built-in proxy (axios.defaults.proxy = false) and uses custom HTTP/HTTPS agents via setAxiosAgents. The axios request interceptor calls setAxiosAgents(config) without proxy parameters, which will create agents without proxy support, potentially overriding the axiosConfig.proxy setting. This approach contradicts the existing proxy architecture.
|
Hey @Lerr1uqs, Thank you for your contribution. We appreciate the time and effort you’ve taken to submit this pull request. Before we can proceed, please ensure the following: Regarding new nodes: If your node integrates with an AI service that you own or represent, please email [email protected] and we will be happy to discuss the best approach. About review timelines: Thank you again for contributing to n8n. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 1 file
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="packages/core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts">
<violation number="1" location="packages/core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts:271">
The manual proxy implementation is incomplete and introduces a regression by ignoring the `NO_PROXY` environment variable, which is handled by the existing proxy infrastructure. This change forces all requests through the proxy, breaking configurations for internal services.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Ask questions if you need clarification on any suggestion
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
| axiosConfig: AxiosRequestConfig, | ||
| authOptions: IRequestOptions['auth'] = {}, | ||
| ) { | ||
| // axios not apply the http.globalAgent, need set it manually |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The manual proxy implementation is incomplete and introduces a regression by ignoring the NO_PROXY environment variable, which is handled by the existing proxy infrastructure. This change forces all requests through the proxy, breaking configurations for internal services.
Prompt for AI agents
Address the following comment on packages/core/src/execution-engine/node-execution-context/utils/request-helper-functions.ts at line 271:
<comment>The manual proxy implementation is incomplete and introduces a regression by ignoring the `NO_PROXY` environment variable, which is handled by the existing proxy infrastructure. This change forces all requests through the proxy, breaking configurations for internal services.</comment>
<file context>
@@ -268,6 +268,16 @@ export async function invokeAxios(
axiosConfig: AxiosRequestConfig,
authOptions: IRequestOptions['auth'] = {},
) {
+ // axios not apply the http.globalAgent, need set it manually
+ const url = process.env.HTTP_PROXY ?? process.env.HTTPS_PROXY ?? process.env.ALL_PROXY;
+ if (url) {
</file context>
problem
The function
invokeAxiosdoesdo not use the global proxy configured ininstallGlobalProxyAgent.issue
#21199
fix
I have set it in axios's config manually instead.
result
Now the request can be successfully routed through the proxy.

Note
Ensure axios requests respect HTTP_PROXY/HTTPS_PROXY/ALL_PROXY by mapping env vars to
axiosConfig.proxyininvokeAxios.HTTP_PROXY/HTTPS_PROXY/ALL_PROXYenv vars toaxiosConfig.proxyinsideinvokeAxiosso axios routes requests via the configured proxy.Written by Cursor Bugbot for commit 496a43e. This will update automatically on new commits. Configure here.