mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
LibWeb/MimeSniff: Port MimeType to new String
This commit is contained in:
parent
fabea2a6a7
commit
2d7ce38ee2
Notes:
sideshowbarker
2024-07-16 23:51:07 +09:00
Author: https://github.com/linusg
Commit: 2d7ce38ee2
Pull-request: https://github.com/SerenityOS/serenity/pull/17698
Reviewed-by: https://github.com/kennethmyhra ✅
7 changed files with 86 additions and 71 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue