From 4e0a09c17e5ad917e0be32b8c4a086e430129575 Mon Sep 17 00:00:00 2001 From: Harjoth Khara Date: Thu, 9 Jul 2026 04:10:46 +0000 Subject: [PATCH] test: bypass proxy env in inspector network fetch test `test-inspector-network-fetch` installs an `EnvHttpProxyAgent` as the global dispatcher only to disable TLS certificate validation for its local self-signed HTTPS server. However, `EnvHttpProxyAgent` also honors the ambient `http_proxy`/`https_proxy` environment variables, so in an environment where a proxy is configured the requests to `http://something.invalid/` are routed through the proxy. This makes the request `origin` the proxy and the request `path` an absolute-form target, so the URL reported to `Network.requestWillBeSent` becomes a malformed concatenation such as `http://127.0.0.1:7769http://something.invalid/`, and the assertions on the request URL fail. Pass `noProxy: '*'` so the dispatcher never routes through a proxy while still disabling certificate validation, making the test independent of ambient proxy configuration. --- test/parallel/test-inspector-network-fetch.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-inspector-network-fetch.js b/test/parallel/test-inspector-network-fetch.js index 790446c84bfb66..e76f2b1e46efc8 100644 --- a/test/parallel/test-inspector-network-fetch.js +++ b/test/parallel/test-inspector-network-fetch.js @@ -12,9 +12,13 @@ const http = require('node:http'); const https = require('node:https'); const inspector = require('node:inspector/promises'); -// Disable certificate validation for the global fetch. +// Disable certificate validation for the global fetch. Also bypass any proxy +// configured through the environment (http_proxy/https_proxy) so that ambient +// proxy settings do not route the requests through a proxy, which would change +// the observed request URLs and make the test fail. const undici = require('internal/deps/undici/undici'); undici.setGlobalDispatcher(new undici.EnvHttpProxyAgent({ + noProxy: '*', connect: { rejectUnauthorized: false, },