Skip to content

Commit bdf03bf

Browse files
authored
http: replace startsWith with strict equality
PR-URL: #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>
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)