Skip to content

Commit d0c5c2d

Browse files
committed
std.net.isValidHostName: fix check
1 parent e4e47d1 commit d0c5c2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/std/net.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ pub fn isValidHostName(hostname: []const u8) bool {
11911191
if (hostname.len >= 254) return false;
11921192
if (!std.unicode.utf8ValidateSlice(hostname)) return false;
11931193
for (hostname) |byte| {
1194-
if (std.ascii.isASCII(byte) or byte == '.' or byte == '-' or std.ascii.isAlphanumeric(byte)) {
1194+
if (!std.ascii.isASCII(byte) or byte == '.' or byte == '-' or std.ascii.isAlphanumeric(byte)) {
11951195
continue;
11961196
}
11971197
return false;

0 commit comments

Comments
 (0)