mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-02 21:59:05 +00:00
os/hostname: switch to std.Io.net.HostName.validate
Zig 0.16's hostname validation routine is RFC 1123-compliant, so we can
use it directly rather than rolling our own.
Ref: efe649b13e
Ref: https://github.com/ziglang/zig/pull/25710
This commit is contained in:
@@ -411,9 +411,9 @@ pub fn isValidCacheKey(key: []const u8) bool {
|
||||
fn isValidHost(host: []const u8) bool {
|
||||
// First check for valid hostnames because this is assumed to be the more
|
||||
// likely ssh host format.
|
||||
if (internal_os.hostname.isValid(host)) {
|
||||
if (std.Io.net.HostName.validate(host)) |_| {
|
||||
return true;
|
||||
}
|
||||
} else |_| {}
|
||||
|
||||
// We also accept valid IP addresses. In practice, IPv4 addresses are also
|
||||
// considered valid hostnames due to their overlapping syntax, so we can
|
||||
|
||||
Reference in New Issue
Block a user