Config: bring back validateUserAgent

This commit is contained in:
Halil Durak committed 2026-04-22 16:08:12 +03:00
1 parent 5e0c046e96
commit 29d8e0c9b7
1 file changed
+12
+12
View File
@@ -653,3 +653,15 @@ pub fn parseArgs(allocator: Allocator) !Config {
const exec_name, const command = try Commands.parse(allocator);
return .init(allocator, exec_name, command);
}
pub fn validateUserAgent(ua: []const u8) !void {
for (ua) |c| {
if (!std.ascii.isPrint(c)) {
return error.NonPrintable;
}
}
if (std.ascii.indexOfIgnoreCase(ua, "mozilla") != null) {
return error.Reserved;
}
}