LibWeb: Make more MimeSniff::MimeType APIs infallible

This commit is contained in:
Andreas Kling
2024-10-14 11:06:43 +02:00
committed by Andreas Kling
parent 9a8db40a23
commit 88e7688940
14 changed files with 55 additions and 56 deletions

View File

@@ -424,7 +424,7 @@ WebIDL::ExceptionOr<void> fetch_classic_worker_script(URL::URL const& url, Envir
auto mime_type_is_javascript = maybe_mime_type.has_value() && maybe_mime_type->is_javascript();
if (response->url().has_value() && Fetch::Infrastructure::is_http_or_https_scheme(response->url()->scheme()) && !mime_type_is_javascript) {
auto mime_type_serialized = maybe_mime_type.has_value() ? MUST(maybe_mime_type->serialized()) : "unknown"_string;
auto mime_type_serialized = maybe_mime_type.has_value() ? maybe_mime_type->serialized() : "unknown"_string;
dbgln("Invalid non-javascript mime type \"{}\" for worker script at {}", mime_type_serialized, response->url().value());
// then run onComplete given null, and abort these steps.