Skip to content

Commit bdf03bf

Browse files
authored
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 a556db4 commit bdf03bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/http.js

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

158158
// Follow curl's behavior: strip leading dot before matching suffixes.
159-
if (entry.startsWith('.')) {
159+
if (entry[0] === '.') {
160160
const suffix = entry.substring(1);
161161
if (host.endsWith(suffix)) return false;
162162
}

0 commit comments

Comments
 (0)