mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
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:
1 file changed
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user