diff options
author | 2022-10-08 01:05:19 -0700 | |
---|---|---|
committer | 2022-10-08 01:06:35 -0700 | |
commit | c2c9173eff9e929004d73e087b62ffdc25f0f4ee (patch) | |
tree | 06357b3ab4761503d35c0d5aeef294706b4036e0 /src/string_immutable.zig | |
parent | 99e7856269ab084c0b5c69d8dac3bcd89ec08e8d (diff) | |
download | bun-c2c9173eff9e929004d73e087b62ffdc25f0f4ee.tar.gz bun-c2c9173eff9e929004d73e087b62ffdc25f0f4ee.tar.zst bun-c2c9173eff9e929004d73e087b62ffdc25f0f4ee.zip |
Fix https://github.com/oven-sh/bun/issues/1263
What happened: when moving to uSockets for the http client, I forgot to call `SSL_set_tlsext_host_name` and uSockets apparently doesn't do that
Diffstat (limited to 'src/string_immutable.zig')
-rw-r--r-- | src/string_immutable.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/string_immutable.zig b/src/string_immutable.zig index acf9d057c..f2ef8f252 100644 --- a/src/string_immutable.zig +++ b/src/string_immutable.zig @@ -3698,3 +3698,14 @@ test "eqlCaseInsensitiveASCII" { try std.testing.expect(!eqlCaseInsensitiveASCII("aBcD", "NOOO", true)); try std.testing.expect(!eqlCaseInsensitiveASCII("aBcD", "LENGTH CHECK", true)); } + +pub fn isIPAddress(input: []const u8) bool { + if (containsChar(input, ':')) + return true; + + if (std.x.os.IPv4.parse(input)) |_| { + return true; + } else |_| { + return false; + } +} |