AK+LibURL+LibWeb: Use simdutf to validate ASCII strings

simdutf provides a vectorized ASCII validator, so let's use that instead
of looping over strings manually.
This commit is contained in:
Timothy Flynn 2025-04-06 08:39:05 -04:00 committed by Tim Flynn
commit ee6b2db009
Notes: github-actions[bot] 2025-04-06 15:06:55 +00:00
10 changed files with 32 additions and 11 deletions

View file

@ -436,7 +436,7 @@ MultipartParsingErrorOr<Vector<XHR::FormDataEntry>> parse_multipart_form_data(JS
header.content_type = "text/plain"_string;
// 2. If contentType is not an ASCII string, set contentType to the empty string.
if (!all_of(header.content_type->code_points(), is_ascii)) {
if (!header.content_type->is_ascii()) {
header.content_type = ""_string;
}