@@ -381,22 +381,28 @@ if (!amMainInstance) {
381
381
const serverBinPath = path . join ( RESOURCES_PATH , 'httptoolkit-server' , 'bin' , binName ) ;
382
382
const serverBinCommand = isWindows ? `"${ serverBinPath } "` : serverBinPath ;
383
383
384
+ const envVars = {
385
+ ...process . env ,
386
+
387
+ HTK_SERVER_TOKEN : AUTH_TOKEN ,
388
+ NODE_SKIP_PLATFORM_CHECK : '1' ,
389
+ OPENSSL_CONF : undefined , // Not relevant to us, and if set this can crash Node.js
390
+
391
+ NODE_OPTIONS :
392
+ process . env . HTTPTOOLKIT_NODE_OPTIONS || // Allow manually configuring node options
393
+ [
394
+ "--max-http-header-size=102400" , // By default, set max header size to 100KB
395
+ "--insecure-http-parser" // Allow invalid HTTP, e.g. header values - we'd rather be invisible than strict
396
+ ] . join ( ' ' )
397
+ }
398
+
384
399
server = spawn ( serverBinCommand , [ 'start' ] , {
385
400
windowsHide : true ,
386
401
stdio : [ 'inherit' , 'pipe' , 'pipe' ] ,
387
402
shell : isWindows , // Required to spawn a .cmd script
388
403
windowsVerbatimArguments : false , // Fixes quoting in windows shells
389
404
detached : ! isWindows , // Detach on Linux, so we can cleanly kill as a group
390
- env : Object . assign ( { } , process . env , {
391
- HTK_SERVER_TOKEN : AUTH_TOKEN ,
392
- NODE_SKIP_PLATFORM_CHECK : '1' ,
393
- NODE_OPTIONS :
394
- process . env . HTTPTOOLKIT_NODE_OPTIONS || // Allow manually configuring node options
395
- [
396
- "--max-http-header-size=102400" , // By default, set max header size to 100KB
397
- "--insecure-http-parser" // Allow invalid HTTP, e.g. header values - we'd rather be invisible than strict
398
- ] . join ( ' ' )
399
- } )
405
+ env : envVars
400
406
} ) ;
401
407
402
408
// Both not null because we pass 'pipe' for args 2 & 3 above.
0 commit comments