Fix #1393 - cleanup mime types

This commit is contained in:
Sergey Lyubka 2021-11-01 20:31:45 +00:00
parent 423aaa492c
commit 12fe66370f
2 changed files with 8 additions and 48 deletions

View File

@ -1183,50 +1183,30 @@ static struct mg_str guess_content_type(struct mg_str path, const char *extra) {
MIME_ENTRY("js", "text/javascript; charset=utf-8"),
MIME_ENTRY("gif", "image/gif"),
MIME_ENTRY("png", "image/png"),
MIME_ENTRY("jpg", "image/jpeg"),
MIME_ENTRY("jpeg", "image/jpeg"),
MIME_ENTRY("woff", "font/woff"),
MIME_ENTRY("ttf", "font/ttf"),
MIME_ENTRY("aac", "audio/aac"),
MIME_ENTRY("svg", "image/svg+xml"),
MIME_ENTRY("txt", "text/plain; charset=utf-8"),
MIME_ENTRY("avi", "video/x-msvideo"),
MIME_ENTRY("azw", "application/vnd.amazon.ebook"),
MIME_ENTRY("bin", "application/octet-stream"),
MIME_ENTRY("bmp", "image/bmp"),
MIME_ENTRY("bz", "application/x-bzip"),
MIME_ENTRY("bz2", "application/x-bzip2"),
MIME_ENTRY("csv", "text/csv"),
MIME_ENTRY("doc", "application/msword"),
MIME_ENTRY("epub", "application/epub+zip"),
MIME_ENTRY("exe", "application/octet-stream"),
MIME_ENTRY("gz", "application/gzip"),
MIME_ENTRY("ico", "image/x-icon"),
MIME_ENTRY("json", "application/json"),
MIME_ENTRY("mid", "audio/mid"),
MIME_ENTRY("mjs", "text/javascript"),
MIME_ENTRY("mov", "video/quicktime"),
MIME_ENTRY("mp3", "audio/mpeg"),
MIME_ENTRY("mp4", "video/mp4"),
MIME_ENTRY("mpeg", "video/mpeg"),
MIME_ENTRY("mpg", "video/mpeg"),
MIME_ENTRY("ogg", "application/ogg"),
MIME_ENTRY("pdf", "application/pdf"),
MIME_ENTRY("rar", "application/rar"),
MIME_ENTRY("rtf", "application/rtf"),
MIME_ENTRY("shtml", "text/html; charset=utf-8"),
MIME_ENTRY("svg", "image/svg+xml"),
MIME_ENTRY("tar", "application/tar"),
MIME_ENTRY("tgz", "application/tar-gz"),
MIME_ENTRY("txt", "text/plain; charset=utf-8"),
MIME_ENTRY("wasm", "application/wasm"),
MIME_ENTRY("wav", "audio/wav"),
MIME_ENTRY("weba", "audio/webm"),
MIME_ENTRY("webm", "video/webm"),
MIME_ENTRY("webp", "image/webp"),
MIME_ENTRY("xls", "application/excel"),
MIME_ENTRY("xml", "application/xml"),
MIME_ENTRY("xsl", "application/xml"),
MIME_ENTRY("zip", "application/zip"),
MIME_ENTRY("3gp", "video/3gpp"),
MIME_ENTRY("7z", "application/x-7z-compressed"),
MIME_ENTRY("7z", "application/x-7z-compressed"),
{{0, 0}, {0, 0}},
};
size_t i = 0;

View File

@ -434,50 +434,30 @@ static struct mg_str guess_content_type(struct mg_str path, const char *extra) {
MIME_ENTRY("js", "text/javascript; charset=utf-8"),
MIME_ENTRY("gif", "image/gif"),
MIME_ENTRY("png", "image/png"),
MIME_ENTRY("jpg", "image/jpeg"),
MIME_ENTRY("jpeg", "image/jpeg"),
MIME_ENTRY("woff", "font/woff"),
MIME_ENTRY("ttf", "font/ttf"),
MIME_ENTRY("aac", "audio/aac"),
MIME_ENTRY("svg", "image/svg+xml"),
MIME_ENTRY("txt", "text/plain; charset=utf-8"),
MIME_ENTRY("avi", "video/x-msvideo"),
MIME_ENTRY("azw", "application/vnd.amazon.ebook"),
MIME_ENTRY("bin", "application/octet-stream"),
MIME_ENTRY("bmp", "image/bmp"),
MIME_ENTRY("bz", "application/x-bzip"),
MIME_ENTRY("bz2", "application/x-bzip2"),
MIME_ENTRY("csv", "text/csv"),
MIME_ENTRY("doc", "application/msword"),
MIME_ENTRY("epub", "application/epub+zip"),
MIME_ENTRY("exe", "application/octet-stream"),
MIME_ENTRY("gz", "application/gzip"),
MIME_ENTRY("ico", "image/x-icon"),
MIME_ENTRY("json", "application/json"),
MIME_ENTRY("mid", "audio/mid"),
MIME_ENTRY("mjs", "text/javascript"),
MIME_ENTRY("mov", "video/quicktime"),
MIME_ENTRY("mp3", "audio/mpeg"),
MIME_ENTRY("mp4", "video/mp4"),
MIME_ENTRY("mpeg", "video/mpeg"),
MIME_ENTRY("mpg", "video/mpeg"),
MIME_ENTRY("ogg", "application/ogg"),
MIME_ENTRY("pdf", "application/pdf"),
MIME_ENTRY("rar", "application/rar"),
MIME_ENTRY("rtf", "application/rtf"),
MIME_ENTRY("shtml", "text/html; charset=utf-8"),
MIME_ENTRY("svg", "image/svg+xml"),
MIME_ENTRY("tar", "application/tar"),
MIME_ENTRY("tgz", "application/tar-gz"),
MIME_ENTRY("txt", "text/plain; charset=utf-8"),
MIME_ENTRY("wasm", "application/wasm"),
MIME_ENTRY("wav", "audio/wav"),
MIME_ENTRY("weba", "audio/webm"),
MIME_ENTRY("webm", "video/webm"),
MIME_ENTRY("webp", "image/webp"),
MIME_ENTRY("xls", "application/excel"),
MIME_ENTRY("xml", "application/xml"),
MIME_ENTRY("xsl", "application/xml"),
MIME_ENTRY("zip", "application/zip"),
MIME_ENTRY("3gp", "video/3gpp"),
MIME_ENTRY("7z", "application/x-7z-compressed"),
MIME_ENTRY("7z", "application/x-7z-compressed"),
{{0, 0}, {0, 0}},
};
size_t i = 0;