Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
https: make https.globalAgent overridable also under ECMAScript Modules#48808
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
nodejs-github-bot commented Jul 17, 2023
Review requested:
|
mcollina left a comment
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.
Thanks for opening a PR! Can you please add a unit test?
whut commented Jul 17, 2023
@mcollina test added, based on test-https-client-override-global-agent.js |
mcollina left a comment
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.
lgtm
nodejs-github-bot commented Jul 17, 2023
targos commented Jul 17, 2023
Does it already work correctly with |
whut commented Jul 17, 2023
Yes, because it already use accessor property |
whut commented Jul 18, 2023
@mcollina I fixed the build failure, I sadly missed to add one "import" of primordial |
mcollina commented Jul 18, 2023
The linter is failing. |
nodejs-github-bot commented Jul 18, 2023
ShogunPanda left a comment
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.
LGTM!
Under ECMAScript modules when you do "import * as https from 'https'" you get a new object with properties copied from https module exports. So if this is a regular data property, you will just override a copy, but if this would be a accessor property, we can still access the actual https.globalAgent. Refs: nodejs#25170, nodejs#9386
whut commented Jul 20, 2023
@mcollina I only now run the test locally, and fixed imports in it to work under ECMAScript modules (e.g. |
nodejs-github-bot commented Jul 20, 2023
mcollina commented Jul 21, 2023
This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open. |
ShogunPanda commented May 15, 2024
@whut Any interest on delivering this? Can you please rebase this PR after the last main branch so we can run CI again? |
Under ECMAScript modules when you do "import * as https from 'https'" you get a new object with properties copied from https module exports. So if this is a regular data property, you will just override a copy, but if this would be a accessor property, we can still access the actual https.globalAgent.
Refs: #25170, #9386