mirror of
https://github.com/nodejs/node.git
synced 2025-12-28 07:50:41 +00: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:
parent
166c72ec02
commit
69b3d2c845
@ -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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user