Uh oh!
There was an error while loading. Please reload this page.
https: make https.globalAgent overridable also under ECMAScript Modules - #48808
https: make https.globalAgent overridable also under ECMAScript Modules#48808whut wants to merge 1 commit into
Conversation
nodejs-github-bot
commented
Jul 17, 2023
Review requested:
|
mcollina
left a comment
There was a problem hiding this comment.
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 |
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
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
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