From bdf03bfcd5420fa9d2ea824d6338080363cdf309 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Thu, 30 Oct 2025 22:43:31 +0800 Subject: [PATCH] http: replace startsWith with strict equality PR-URL: https://github.com/nodejs/node/pull/59394 Reviewed-By: Antoine du Hamel Reviewed-By: Luigi Pinca Reviewed-By: Zeyu "Alex" Yang Reviewed-By: Jordan Harband Reviewed-By: Trivikram Kamat --- lib/internal/http.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/http.js b/lib/internal/http.js index 9bf929f7f33..e664663348a 100644 --- a/lib/internal/http.js +++ b/lib/internal/http.js @@ -156,7 +156,7 @@ class ProxyConfig { if (entry === host || entry === hostWithPort) return false; // Matching host and host:port // Follow curl's behavior: strip leading dot before matching suffixes. - if (entry.startsWith('.')) { + if (entry[0] === '.') { const suffix = entry.substring(1); if (host.endsWith(suffix)) return false; }