http: replace startsWith with strict equality

PR-URL: https://github.com/nodejs/node/pull/59394
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
btea authored and Antoine du Hamel committed 2025-11-13 22:44:15 +01:00
1 parent 02fb7f4ecb
commit 5703ce68bc
1 file changed
+1 -1
+1 -1
View File
@@ -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;
}