mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 10:05:32 +00:00
LibWeb/MimeSniff: Add MimeType::is_archive()
This commit is contained in:
parent
99a47b9276
commit
644cc1d7ee
|
@ -284,6 +284,16 @@ bool MimeType::is_zip_based() const
|
|||
return subtype().ends_with_bytes("+zip"sv) || essence().is_one_of("application/zip"sv);
|
||||
}
|
||||
|
||||
// https://mimesniff.spec.whatwg.org/#archive-mime-type
|
||||
bool MimeType::is_archive() const
|
||||
{
|
||||
// An archive MIME type is any MIME type whose essence is one of the following:
|
||||
// - application/x-rar-compressed
|
||||
// - application/zip
|
||||
// - application/x-gzip
|
||||
return essence().is_one_of("application/x-rar-compressed"sv, "application/zip"sv, "application/x-gzip"sv);
|
||||
}
|
||||
|
||||
// https://mimesniff.spec.whatwg.org/#xml-mime-type
|
||||
bool MimeType::is_xml() const
|
||||
{
|
||||
|
|
|
@ -30,6 +30,7 @@ public:
|
|||
bool is_audio_or_video() const;
|
||||
bool is_font() const;
|
||||
bool is_zip_based() const;
|
||||
bool is_archive() const;
|
||||
bool is_xml() const;
|
||||
bool is_html() const;
|
||||
bool is_javascript() const;
|
||||
|
|
Loading…
Reference in a new issue