mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 04:13:11 +00:00
LibWeb/MimeSniff: Add MimeType::is_image()
This commit is contained in:
parent
2c0f6d8c7b
commit
d2c88faf00
|
@ -238,6 +238,13 @@ ErrorOr<void> MimeType::set_parameter(String name, String value)
|
|||
return {};
|
||||
}
|
||||
|
||||
// https://mimesniff.spec.whatwg.org/#image-mime-type
|
||||
bool MimeType::is_image() const
|
||||
{
|
||||
// An image MIME type is a MIME type whose type is "image".
|
||||
return type() == "image"sv;
|
||||
}
|
||||
|
||||
// https://mimesniff.spec.whatwg.org/#xml-mime-type
|
||||
bool MimeType::is_xml() const
|
||||
{
|
||||
|
|
|
@ -26,6 +26,7 @@ public:
|
|||
String const& subtype() const { return m_subtype; }
|
||||
OrderedHashMap<String, String> const& parameters() const { return m_parameters; }
|
||||
|
||||
bool is_image() const;
|
||||
bool is_xml() const;
|
||||
bool is_html() const;
|
||||
bool is_javascript() const;
|
||||
|
|
Loading…
Reference in a new issue