Add several new known media types:

* CBZ: application/vnd.comicbook+zip, .cbz
  * CBR: application/vnd.comicbook-rar, .cbr
  * RAR: application/vnd.rar, .rar
  * EPUB: application/epub+zip, .epub
  * OPF: application/oebps-package+xml, .opf
  * XHTML: application/xhtml+xml, .xhtml
This commit is contained in:
Aaron Leopold 2022-06-04 22:44:55 -07:00 committed by Sergio Benitez
parent 2fc4b156eb
commit c8b8b2b022
1 changed files with 12 additions and 0 deletions

View File

@ -13,6 +13,8 @@ macro_rules! known_media_types {
CSS (is_css): "CSS", "text", "css" ; "charset" => "utf-8",
FormData (is_form_data): "multipart form data", "multipart", "form-data",
XML (is_xml): "XML", "text", "xml" ; "charset" => "utf-8",
OPF (is_opf): "OPF", "application", "oebps-package+xml",
XHTML (is_xhtml): "XHTML", "application", "xhtml+xml",
CSV (is_csv): "CSV", "text", "csv" ; "charset" => "utf-8",
PNG (is_png): "PNG", "image", "png",
GIF (is_gif): "GIF", "image", "gif",
@ -44,6 +46,10 @@ macro_rules! known_media_types {
MP3 (is_mp3): "MPEG Audio", "audio", "mpeg",
MP4 (is_mp4): "MPEG4 Video", "video", "mp4",
ZIP (is_zip): "ZIP archive", "application", "zip",
CBZ (is_cbz): "Comic ZIP archive", "application", "vnd.comicbook+zip",
CBR (is_cbr): "Comic RAR compressed archive", "application", "vnd.comicbook-rar",
RAR (is_rar): "RAR compressed archive", "application", "vnd.rar",
EPUB (is_epub): "EPUB", "application", "epub+zip",
EventStream (is_event_stream): "SSE stream", "text", "event-stream",
Markdown (is_markdown): "markdown text", "text", "markdown" ; "charset" => "utf-8",
})
@ -55,6 +61,8 @@ macro_rules! known_extensions {
"html" => HTML,
"htm" => HTML,
"xml" => XML,
"opf" => OPF,
"xhtml" => XHTML,
"csv" => CSV,
"js" => JavaScript,
"css" => CSS,
@ -94,6 +102,10 @@ macro_rules! known_extensions {
"tiff" => TIFF,
"mov" => MOV,
"zip" => ZIP,
"cbz" => CBZ,
"cbr" => CBR,
"rar" => RAR,
"epub" => EPUB,
"md" => Markdown,
"markdown" => Markdown,
})