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
commit 88e7688940
Notes: github-actions[bot] 2024-10-14 18:48:50 +00:00
14 changed files with 55 additions and 56 deletions

View file

@ -102,7 +102,7 @@ ErrorOr<DataURL> process_data_url(URL::URL const& data_url)
// 14. If mimeTypeRecord is failure, then set mimeTypeRecord to text/plain;charset=US-ASCII.
if (!mime_type_record.has_value()) {
mime_type_record = MimeSniff::MimeType::create("text"_string, "plain"_string);
TRY(mime_type_record->set_parameter("charset"_string, "US-ASCII"_string));
mime_type_record->set_parameter("charset"_string, "US-ASCII"_string);
}
// 15. Return a new data: URL struct whose MIME type is mimeTypeRecord and body is body.