authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-02-16 19:10:45-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-02-23 02:37:11-07:00
logae630b695e1306ae357a900a44732912eac2a417
treeb22fa1f93646290ec03da97e7381562b40d0f38a
parentf9dff2fcf1d5c6df1d6b935c4eb536793148a9d9

std.http.Client.connect: case insensitive host comparison

for checking if a proxy is connecting to itself

1 files changed, 3 insertions(+), 1 deletions(-)

lib/std/http/Client.zig+3-1
...@@ -1412,7 +1412,9 @@ pub fn connect(...@@ -1412,7 +1412,9 @@ pub fn connect(
1412 } orelse return client.connectTcp(host, port, protocol);1412 } orelse return client.connectTcp(host, port, protocol);
14131413
1414 // Prevent proxying through itself.1414 // Prevent proxying through itself.
1415 if (std.mem.eql(u8, proxy.host, host) and proxy.port == port and proxy.protocol == protocol) {1415 if (std.ascii.eqlIgnoreCase(proxy.host, host) and
1416 proxy.port == port and proxy.protocol == protocol)
1417 {
1416 return client.connectTcp(host, port, protocol);1418 return client.connectTcp(host, port, protocol);
1417 }1419 }
14181420