Skip to content

Commit 7599e2e

Browse files
bteaaduh95
authored andcommitted
http: replace startsWith with strict equality
PR-URL: #59394 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Zeyu "Alex" Yang <[email protected]> Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent e051775 commit 7599e2e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/internal/http.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class ProxyConfig {
150150
if (entry === host || entry === hostWithPort) return false; // Matching host and host:port
151151

152152
// Follow curl's behavior: strip leading dot before matching suffixes.
153-
if (entry.startsWith('.')) {
153+
if (entry[0] === '.') {
154154
const suffix = entry.substring(1);
155155
if (host.endsWith(suffix)) return false;
156156
}

0 commit comments

Comments
 (0)