Skip to content

Conversation

@Lerr1uqs
Copy link

@Lerr1uqs Lerr1uqs commented Nov 8, 2025

problem

The function invokeAxiosdoes do not use the global proxy configured in installGlobalProxyAgent.

issue

#21199

fix

I have set it in axios's config manually instead.

result

Now the request can be successfully routed through the proxy.
image


Note

Ensure axios requests respect HTTP_PROXY/HTTPS_PROXY/ALL_PROXY by mapping env vars to axiosConfig.proxy in invokeAxios.

  • Core HTTP requests:
    • Map HTTP_PROXY/HTTPS_PROXY/ALL_PROXY env vars to axiosConfig.proxy inside invokeAxios so axios routes requests via the configured proxy.

Written by Cursor Bugbot for commit 496a43e. This will update automatically on new commits. Configure here.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

@cursor cursor bot left a 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(':', ''),
};
}
Copy link

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.

Fix in Cursor Fix in Web

@n8n-assistant n8n-assistant bot added community Authored by a community member core Enhancement outside /nodes-base and /editor-ui in linear Issue or PR has been created in Linear for internal review labels Nov 8, 2025
@n8n-assistant
Copy link

n8n-assistant bot commented Nov 8, 2025

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:
• Tests are included for any new functionality, logic changes or bug fixes.
• The PR aligns with our contribution guidelines.

Regarding new nodes:
We no longer accept new nodes directly into the core codebase. Instead, we encourage contributors to follow our Community Node Submission Guide to publish nodes independently.

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:
This PR has been added to our internal tracker as "GHC-5412". While we plan to review it, we are currently unable to provide an exact timeframe. Our goal is to begin reviews within a month, but this may change depending on team priorities. We will reach out when the review begins.

Thank you again for contributing to n8n.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a 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
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 8, 2025

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[&#39;auth&#39;] = {},
 ) {
+	// 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>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Authored by a community member core Enhancement outside /nodes-base and /editor-ui in linear Issue or PR has been created in Linear for internal review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants