Skip to content
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

fix: fix EnvHttpProxyAgent for the Node.js bundle #4064

Merged
merged 2 commits into from
Feb 26, 2025

Conversation

joyeecheung
Copy link
Member

@joyeecheung joyeecheung commented Feb 21, 2025

This relates to...

Refs: nodejs/node#57165

Rationale

The Dispatcher needs some prototype methods from lib/api for EnvHttpProxyAgent, otherwise it's incomplete, and throws a TypeError: this[kClient].connect is not a function when EnvHttpProxyAgent is handling requests inside the Node.js bundle.

Changes

Make the Dispatcher prototype complete in the Node.js bundle.

Features

Bug Fixes

Breaking Changes and Deprecations

Status

The Dispatcher needs some methods from lib/api for EnvHttpProxyAgent,
otherwise it's incomplete.
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina
Copy link
Member

Can you add a test for it?

Copy link
Member

@mertcanaltin mertcanaltin left a comment

Choose a reason for hiding this comment

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

LGTM

@joyeecheung
Copy link
Member Author

Added a test - I didn't use mocks but spin up two servers to try to exercise more paths, in case the mocks hide any real issues in the paths that would be otherwise exercised if used for real. Also I just wrote the test to use them together since nodejs/node#57165 doesn't need them exposed individually.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit a217002 into nodejs:main Feb 26, 2025
28 of 31 checks passed
@github-actions github-actions bot mentioned this pull request Feb 28, 2025
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.

4 participants