mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibWeb/MimeSniff: Port MimeType to new String
This commit is contained in:
Notes:
sideshowbarker
2024-07-16 23:51:07 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/2d7ce38ee2 Pull-request: https://github.com/SerenityOS/serenity/pull/17698 Reviewed-by: https://github.com/kennethmyhra ✅
@@ -218,12 +218,12 @@ void HTMLObjectElement::resource_did_load()
|
||||
|
||||
static bool is_xml_mime_type(StringView resource_type)
|
||||
{
|
||||
auto mime_type = MimeSniff::MimeType::parse(resource_type);
|
||||
auto mime_type = MimeSniff::MimeType::parse(resource_type).release_value_but_fixme_should_propagate_errors();
|
||||
if (!mime_type.has_value())
|
||||
return false;
|
||||
|
||||
// An XML MIME type is any MIME type whose subtype ends in "+xml" or whose essence is "text/xml" or "application/xml". [RFC7303]
|
||||
if (mime_type->subtype().ends_with("+xml"sv))
|
||||
if (mime_type->subtype().ends_with_bytes("+xml"sv))
|
||||
return true;
|
||||
|
||||
return mime_type->essence().is_one_of("text/xml"sv, "application/xml"sv);
|
||||
|
||||
Reference in New Issue
Block a user