Skip to content

Commit 4170359

Browse files
joyeecheungRafaelGSS
authored andcommitted
bootstrap: initialize http proxy after user module loader setup
The externalized undici relies on the user module loader, so in the externalized build, initialization of http proxy which relies on undici needs to be deferred until after the user module loader is initialized. PR-URL: #58938 Refs: #58865 Refs: #57872 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <richard.lau@ibm.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 8d4f6a0 commit 4170359

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/internal/process/pre_execution.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ function prepareExecution(options) {
126126
initializeConfigFileSupport();
127127

128128
require('internal/dns/utils').initializeDns();
129-
setupHttpProxy();
130129

131130
if (isMainThread) {
132131
assert(internalBinding('worker').isMainThread);
@@ -159,6 +158,10 @@ function prepareExecution(options) {
159158
setupUserModules(forceDefaultLoader);
160159
}
161160

161+
// This has to be done after the user module loader is initialized,
162+
// in case undici is externalized.
163+
setupHttpProxy();
164+
162165
return mainEntry;
163166
}
164167

0 commit comments

Comments
 (0)