Skip to content

fix(github-api): restore proxy-server support with undici dispatcher - #2846

Open
anishesg wants to merge 1 commit into
googleapis:mainfrom
proudhare:fix/ph-issue-2838
Open

fix(github-api): restore proxy-server support with undici dispatcher#2846
anishesg wants to merge 1 commit into
googleapis:mainfrom
proudhare:fix/ph-issue-2838

Conversation

@anishesg

Copy link
Copy Markdown

The proxy-server input was silently ignored because @octokit/request v8 dropped support for request.agent in favor of native fetch with dispatchers. The proxy configuration was being passed as request.agent to Octokit and GraphQL clients, but this parameter is filtered out before reaching the fetch call.

This change replaces the createDefaultAgent method with createProxyFetch that creates a custom fetch function using undici's ProxyAgent as a dispatcher. The proxy agent is now properly passed through the fetch options, which is compatible with @octokit/request v8's architecture. The fix adds undici as a dependency and updates tests to validate the new proxy fetch implementation.

Users who relied on the NODE_USE_ENV_PROXY + HTTPS_PROXY workaround will continue to work as expected, and the documented proxy-server input now functions correctly.

Fixes #2838

The `proxy-server` input was silently ignored because `@octokit/request` v8 dropped support for `request.agent` in favor of native fetch with dispatchers. The proxy configuration was being passed as `request.agent` to Octokit and GraphQL clients, but this parameter is filtered out before reaching the fetch call.

Signed-off-by: anish <anishesg@users.noreply.github.com>
@LunaticMuch

Copy link
Copy Markdown

+1 I have similar issues. For what it matters...I checked and LGTM. Thanks @anishesg <3

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

Labels

size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

proxy-server input is silently ignored (request.agent dropped by @octokit/request v8 native fetch)

2 participants