Skip to content

Commit 5703ce6

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 02fb7f4 commit 5703ce6

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)returnfalse;// 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
constsuffix=entry.substring(1);
161161
if(host.endsWith(suffix))returnfalse;
162162
}

0 commit comments

Comments
(0)