You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lua_mime_types.lua 27KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745
  1. --[[
  2. Copyright (c) 2022, Vsevolod Stakhov <vsevolod@rspamd.com>
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ]]--
  13. --[[[
  14. -- @module lua_mime_types
  15. -- This module contains mime types list
  16. --]]
  17. local exports = {}
  18. -- All mime extensions with corresponding content types
  19. exports.full_extensions_map = {
  20. { "323", "text/h323" },
  21. { "3g2", "video/3gpp2" },
  22. { "3gp", "video/3gpp" },
  23. { "3gp2", "video/3gpp2" },
  24. { "3gpp", "video/3gpp" },
  25. { "7z", { "application/x-7z-compressed", "application/7z" } },
  26. { "aa", "audio/audible" },
  27. { "AAC", "audio/aac" },
  28. { "aaf", "application/octet-stream" },
  29. { "aax", "audio/vnd.audible.aax" },
  30. { "ac3", "audio/ac3" },
  31. { "aca", "application/octet-stream" },
  32. { "accda", "application/msaccess.addin" },
  33. { "accdb", "application/msaccess" },
  34. { "accdc", "application/msaccess.cab" },
  35. { "accde", "application/msaccess" },
  36. { "accdr", "application/msaccess.runtime" },
  37. { "accdt", "application/msaccess" },
  38. { "accdw", "application/msaccess.webapplication" },
  39. { "accft", "application/msaccess.ftemplate" },
  40. { "acx", "application/internet-property-stream" },
  41. { "AddIn", "text/xml" },
  42. { "ade", "application/msaccess" },
  43. { "adobebridge", "application/x-bridge-url" },
  44. { "adp", "application/msaccess" },
  45. { "ADT", "audio/vnd.dlna.adts" },
  46. { "ADTS", "audio/aac" },
  47. { "afm", "application/octet-stream" },
  48. { "ai", "application/postscript" },
  49. { "aif", "audio/aiff" },
  50. { "aifc", "audio/aiff" },
  51. { "aiff", "audio/aiff" },
  52. { "air", "application/vnd.adobe.air-application-installer-package+zip" },
  53. { "amc", "application/mpeg" },
  54. { "anx", "application/annodex" },
  55. { "apk", "application/vnd.android.package-archive" },
  56. { "application", "application/x-ms-application" },
  57. { "art", "image/x-jg" },
  58. { "asa", "application/xml" },
  59. { "asax", "application/xml" },
  60. { "ascx", "application/xml" },
  61. { "asd", "application/octet-stream" },
  62. { "asf", "video/x-ms-asf" },
  63. { "ashx", "application/xml" },
  64. { "asi", "application/octet-stream" },
  65. { "asm", "text/plain" },
  66. { "asmx", "application/xml" },
  67. { "aspx", "application/xml" },
  68. { "asr", "video/x-ms-asf" },
  69. { "asx", "video/x-ms-asf" },
  70. { "atom", "application/atom+xml" },
  71. { "au", "audio/basic" },
  72. { "avi", "video/x-msvideo" },
  73. { "axa", "audio/annodex" },
  74. { "axs", "application/olescript" },
  75. { "axv", "video/annodex" },
  76. { "bas", "text/plain" },
  77. { "bcpio", "application/x-bcpio" },
  78. { "bin", "application/octet-stream" },
  79. { "bmp", { "image/bmp", "image/x-ms-bmp" } },
  80. { "c", "text/plain" },
  81. { "cab", "application/octet-stream" },
  82. { "caf", "audio/x-caf" },
  83. { "calx", "application/vnd.ms-office.calx" },
  84. { "cat", "application/vnd.ms-pki.seccat" },
  85. { "cc", "text/plain" },
  86. { "cd", "text/plain" },
  87. { "cdda", "audio/aiff" },
  88. { "cdf", "application/x-cdf" },
  89. { "cer", "application/x-x509-ca-cert" },
  90. { "cfg", "text/plain" },
  91. { "chm", "application/octet-stream" },
  92. { "class", "application/x-java-applet" },
  93. { "clp", "application/x-msclip" },
  94. { "cmd", "text/plain" },
  95. { "cmx", "image/x-cmx" },
  96. { "cnf", "text/plain" },
  97. { "cod", "image/cis-cod" },
  98. { "config", "application/xml" },
  99. { "contact", "text/x-ms-contact" },
  100. { "coverage", "application/xml" },
  101. { "cpio", "application/x-cpio" },
  102. { "cpp", "text/plain" },
  103. { "crd", "application/x-mscardfile" },
  104. { "crl", "application/pkix-crl" },
  105. { "crt", "application/x-x509-ca-cert" },
  106. { "cs", "text/plain" },
  107. { "csdproj", "text/plain" },
  108. { "csh", "application/x-csh" },
  109. { "csproj", "text/plain" },
  110. { "css", "text/css" },
  111. { "csv", { "application/vnd.ms-excel", "text/csv", "text/plain" } },
  112. { "cur", "application/octet-stream" },
  113. { "cxx", "text/plain" },
  114. { "dat", { "application/octet-stream", "application/ms-tnef" } },
  115. { "datasource", "application/xml" },
  116. { "dbproj", "text/plain" },
  117. { "dcr", "application/x-director" },
  118. { "def", "text/plain" },
  119. { "deploy", "application/octet-stream" },
  120. { "der", "application/x-x509-ca-cert" },
  121. { "dgml", "application/xml" },
  122. { "dib", "image/bmp" },
  123. { "dif", "video/x-dv" },
  124. { "dir", "application/x-director" },
  125. { "disco", "text/xml" },
  126. { "divx", "video/divx" },
  127. { "dll", "application/x-msdownload" },
  128. { "dll.config", "text/xml" },
  129. { "dlm", "text/dlm" },
  130. { "doc", "application/msword" },
  131. { "docm", "application/vnd.ms-word.document.macroEnabled.12" },
  132. { "docx", {
  133. "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  134. "application/msword",
  135. "application/vnd.ms-word.document.12",
  136. "application/octet-stream",
  137. } },
  138. { "dot", "application/msword" },
  139. { "dotm", "application/vnd.ms-word.template.macroEnabled.12" },
  140. { "dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template" },
  141. { "dsp", "application/octet-stream" },
  142. { "dsw", "text/plain" },
  143. { "dtd", "text/xml" },
  144. { "dtsConfig", "text/xml" },
  145. { "dv", "video/x-dv" },
  146. { "dvi", "application/x-dvi" },
  147. { "dwf", "drawing/x-dwf" },
  148. { "dwg", { "application/acad", "image/vnd.dwg" } },
  149. { "dwp", "application/octet-stream" },
  150. { "dxf", "application/x-dxf" },
  151. { "dxr", "application/x-director" },
  152. { "eml", "message/rfc822" },
  153. { "emz", "application/octet-stream" },
  154. { "eot", "application/vnd.ms-fontobject" },
  155. { "eps", "application/postscript" },
  156. { "etl", "application/etl" },
  157. { "etx", "text/x-setext" },
  158. { "evy", "application/envoy" },
  159. { "exe", {
  160. "application/x-dosexec",
  161. "application/x-msdownload",
  162. "application/x-executable",
  163. } },
  164. { "exe.config", "text/xml" },
  165. { "fdf", "application/vnd.fdf" },
  166. { "fif", "application/fractals" },
  167. { "filters", "application/xml" },
  168. { "fla", "application/octet-stream" },
  169. { "flac", "audio/flac" },
  170. { "flr", "x-world/x-vrml" },
  171. { "flv", "video/x-flv" },
  172. { "fsscript", "application/fsharp-script" },
  173. { "fsx", "application/fsharp-script" },
  174. { "generictest", "application/xml" },
  175. { "gif", "image/gif" },
  176. { "gpx", "application/gpx+xml" },
  177. { "group", "text/x-ms-group" },
  178. { "gsm", "audio/x-gsm" },
  179. { "gtar", "application/x-gtar" },
  180. { "gz", { "application/gzip", "application/x-gzip", "application/tlsrpt+gzip" } },
  181. { "h", "text/plain" },
  182. { "hdf", "application/x-hdf" },
  183. { "hdml", "text/x-hdml" },
  184. { "hhc", "application/x-oleobject" },
  185. { "hhk", "application/octet-stream" },
  186. { "hhp", "application/octet-stream" },
  187. { "hlp", "application/winhlp" },
  188. { "hpp", "text/plain" },
  189. { "hqx", "application/mac-binhex40" },
  190. { "hta", "application/hta" },
  191. { "htc", "text/x-component" },
  192. { "htm", "text/html" },
  193. { "html", "text/html" },
  194. { "htt", "text/webviewhtml" },
  195. { "hxa", "application/xml" },
  196. { "hxc", "application/xml" },
  197. { "hxd", "application/octet-stream" },
  198. { "hxe", "application/xml" },
  199. { "hxf", "application/xml" },
  200. { "hxh", "application/octet-stream" },
  201. { "hxi", "application/octet-stream" },
  202. { "hxk", "application/xml" },
  203. { "hxq", "application/octet-stream" },
  204. { "hxr", "application/octet-stream" },
  205. { "hxs", "application/octet-stream" },
  206. { "hxt", "text/html" },
  207. { "hxv", "application/xml" },
  208. { "hxw", "application/octet-stream" },
  209. { "hxx", "text/plain" },
  210. { "i", "text/plain" },
  211. { "ico", "image/x-icon" },
  212. { "ics", { "text/calendar", "application/ics", "application/octet-stream" } },
  213. { "idl", "text/plain" },
  214. { "ief", "image/ief" },
  215. { "iii", "application/x-iphone" },
  216. { "inc", "text/plain" },
  217. { "inf", "application/octet-stream" },
  218. { "ini", "text/plain" },
  219. { "inl", "text/plain" },
  220. { "ins", "application/x-internet-signup" },
  221. { "ipa", "application/x-itunes-ipa" },
  222. { "ipg", "application/x-itunes-ipg" },
  223. { "ipproj", "text/plain" },
  224. { "ipsw", "application/x-itunes-ipsw" },
  225. { "iqy", "text/x-ms-iqy" },
  226. { "isp", "application/x-internet-signup" },
  227. { "ite", "application/x-itunes-ite" },
  228. { "itlp", "application/x-itunes-itlp" },
  229. { "itms", "application/x-itunes-itms" },
  230. { "itpc", "application/x-itunes-itpc" },
  231. { "IVF", "video/x-ivf" },
  232. { "jar", "application/java-archive" },
  233. { "java", "application/octet-stream" },
  234. { "jck", "application/liquidmotion" },
  235. { "jcz", "application/liquidmotion" },
  236. { "jfif", { "image/jpeg", "image/pjpeg" } },
  237. { "jnlp", "application/x-java-jnlp-file" },
  238. { "jpb", "application/octet-stream" },
  239. { "jpe", { "image/jpeg", "image/pjpeg" } },
  240. { "jpeg", { "image/jpeg", "image/pjpeg" } },
  241. { "jpg", { "image/jpeg", "image/pjpeg" } },
  242. { "js", "application/javascript" },
  243. { "json", "application/json" },
  244. { "jsx", "text/jscript" },
  245. { "jsxbin", "text/plain" },
  246. { "latex", "application/x-latex" },
  247. { "library-ms", "application/windows-library+xml" },
  248. { "lit", "application/x-ms-reader" },
  249. { "loadtest", "application/xml" },
  250. { "lpk", "application/octet-stream" },
  251. { "lsf", "video/x-la-asf" },
  252. { "lst", "text/plain" },
  253. { "lsx", "video/x-la-asf" },
  254. { "lzh", "application/octet-stream" },
  255. { "m13", "application/x-msmediaview" },
  256. { "m14", "application/x-msmediaview" },
  257. { "m1v", "video/mpeg" },
  258. { "m2t", "video/vnd.dlna.mpeg-tts" },
  259. { "m2ts", "video/vnd.dlna.mpeg-tts" },
  260. { "m2v", "video/mpeg" },
  261. { "m3u", "audio/x-mpegurl" },
  262. { "m3u8", "audio/x-mpegurl" },
  263. { "m4a", { "audio/m4a", "audio/x-m4a" } },
  264. { "m4b", "audio/m4b" },
  265. { "m4p", "audio/m4p" },
  266. { "m4r", "audio/x-m4r" },
  267. { "m4v", "video/x-m4v" },
  268. { "mac", "image/x-macpaint" },
  269. { "mak", "text/plain" },
  270. { "man", "application/x-troff-man" },
  271. { "manifest", "application/x-ms-manifest" },
  272. { "map", "text/plain" },
  273. { "master", "application/xml" },
  274. { "mbox", "application/mbox" },
  275. { "mda", "application/msaccess" },
  276. { "mdb", "application/x-msaccess" },
  277. { "mde", "application/msaccess" },
  278. { "mdp", "application/octet-stream" },
  279. { "me", "application/x-troff-me" },
  280. { "mfp", "application/x-shockwave-flash" },
  281. { "mht", "message/rfc822" },
  282. { "mhtml", "message/rfc822" },
  283. { "mid", "audio/mid" },
  284. { "midi", "audio/mid" },
  285. { "mix", "application/octet-stream" },
  286. { "mk", "text/plain" },
  287. { "mmf", "application/x-smaf" },
  288. { "mno", "text/xml" },
  289. { "mny", "application/x-msmoney" },
  290. { "mod", "video/mpeg" },
  291. { "mov", "video/quicktime" },
  292. { "movie", "video/x-sgi-movie" },
  293. { "mp2", "video/mpeg" },
  294. { "mp2v", "video/mpeg" },
  295. { "mp3", { "audio/mpeg", "audio/mpeg3", "audio/mp3", "audio/x-mpeg-3" } },
  296. { "mp4", "video/mp4" },
  297. { "mp4v", "video/mp4" },
  298. { "mpa", "video/mpeg" },
  299. { "mpe", "video/mpeg" },
  300. { "mpeg", "video/mpeg" },
  301. { "mpf", "application/vnd.ms-mediapackage" },
  302. { "mpg", "video/mpeg" },
  303. { "mpp", "application/vnd.ms-project" },
  304. { "mpv2", "video/mpeg" },
  305. { "mqv", "video/quicktime" },
  306. { "ms", "application/x-troff-ms" },
  307. { "msg", "application/vnd.ms-outlook" },
  308. { "msi", { "application/x-msi", "application/octet-stream" } },
  309. { "mso", "application/octet-stream" },
  310. { "mts", "video/vnd.dlna.mpeg-tts" },
  311. { "mtx", "application/xml" },
  312. { "mvb", "application/x-msmediaview" },
  313. { "mvc", "application/x-miva-compiled" },
  314. { "mxp", "application/x-mmxp" },
  315. { "nc", "application/x-netcdf" },
  316. { "nsc", "video/x-ms-asf" },
  317. { "nws", "message/rfc822" },
  318. { "ocx", "application/octet-stream" },
  319. { "oda", "application/oda" },
  320. { "odb", "application/vnd.oasis.opendocument.database" },
  321. { "odc", "application/vnd.oasis.opendocument.chart" },
  322. { "odf", "application/vnd.oasis.opendocument.formula" },
  323. { "odg", "application/vnd.oasis.opendocument.graphics" },
  324. { "odh", "text/plain" },
  325. { "odi", "application/vnd.oasis.opendocument.image" },
  326. { "odl", "text/plain" },
  327. { "odm", "application/vnd.oasis.opendocument.text-master" },
  328. { "odp", "application/vnd.oasis.opendocument.presentation" },
  329. { "ods", "application/vnd.oasis.opendocument.spreadsheet" },
  330. { "odt", "application/vnd.oasis.opendocument.text" },
  331. { "oga", "audio/ogg" },
  332. { "ogg", "audio/ogg" },
  333. { "ogv", "video/ogg" },
  334. { "ogx", "application/ogg" },
  335. { "one", "application/onenote" },
  336. { "onea", "application/onenote" },
  337. { "onepkg", "application/onenote" },
  338. { "onetmp", "application/onenote" },
  339. { "onetoc", "application/onenote" },
  340. { "onetoc2", "application/onenote" },
  341. { "opus", "audio/ogg" },
  342. { "orderedtest", "application/xml" },
  343. { "osdx", "application/opensearchdescription+xml" },
  344. { "otf", "application/font-sfnt" },
  345. { "otg", "application/vnd.oasis.opendocument.graphics-template" },
  346. { "oth", "application/vnd.oasis.opendocument.text-web" },
  347. { "otp", "application/vnd.oasis.opendocument.presentation-template" },
  348. { "ots", "application/vnd.oasis.opendocument.spreadsheet-template" },
  349. { "ott", "application/vnd.oasis.opendocument.text-template" },
  350. { "oxt", "application/vnd.openofficeorg.extension" },
  351. { "p10", "application/pkcs10" },
  352. { "p12", "application/x-pkcs12" },
  353. { "p7b", "application/x-pkcs7-certificates" },
  354. { "p7c", "application/pkcs7-mime" },
  355. { "p7m", "application/pkcs7-mime", "application/x-pkcs7-mime" },
  356. { "p7r", "application/x-pkcs7-certreqresp" },
  357. { "p7s", { "application/pkcs7-signature", "application/x-pkcs7-signature", "text/plain" } },
  358. { "pbm", "image/x-portable-bitmap" },
  359. { "pcast", "application/x-podcast" },
  360. { "pct", "image/pict" },
  361. { "pcx", "application/octet-stream" },
  362. { "pcz", "application/octet-stream" },
  363. { "pdf", "application/pdf" },
  364. { "pfb", "application/octet-stream" },
  365. { "pfm", "application/octet-stream" },
  366. { "pfx", "application/x-pkcs12" },
  367. { "pgm", "image/x-portable-graymap" },
  368. { "pic", "image/pict" },
  369. { "pict", "image/pict" },
  370. { "pkgdef", "text/plain" },
  371. { "pkgundef", "text/plain" },
  372. { "pko", "application/vnd.ms-pki.pko" },
  373. { "pls", "audio/scpls" },
  374. { "pma", "application/x-perfmon" },
  375. { "pmc", "application/x-perfmon" },
  376. { "pml", "application/x-perfmon" },
  377. { "pmr", "application/x-perfmon" },
  378. { "pmw", "application/x-perfmon" },
  379. { "png", "image/png" },
  380. { "pnm", "image/x-portable-anymap" },
  381. { "pnt", "image/x-macpaint" },
  382. { "pntg", "image/x-macpaint" },
  383. { "pnz", "image/png" },
  384. { "pot", "application/vnd.ms-powerpoint" },
  385. { "potm", "application/vnd.ms-powerpoint.template.macroEnabled.12" },
  386. { "potx", "application/vnd.openxmlformats-officedocument.presentationml.template" },
  387. { "ppa", "application/vnd.ms-powerpoint" },
  388. { "ppam", "application/vnd.ms-powerpoint.addin.macroEnabled.12" },
  389. { "ppm", "image/x-portable-pixmap" },
  390. { "pps", "application/vnd.ms-powerpoint" },
  391. { "ppsm", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12" },
  392. { "ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow" },
  393. { "ppt", "application/vnd.ms-powerpoint" },
  394. { "pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12" },
  395. { "pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation" },
  396. { "prf", "application/pics-rules" },
  397. { "prm", "application/octet-stream" },
  398. { "prx", "application/octet-stream" },
  399. { "ps", "application/postscript" },
  400. { "psc1", "application/PowerShell" },
  401. { "psd", "application/octet-stream" },
  402. { "psess", "application/xml" },
  403. { "psm", "application/octet-stream" },
  404. { "psp", "application/octet-stream" },
  405. { "pst", "application/vnd.ms-outlook" },
  406. { "pub", "application/x-mspublisher" },
  407. { "pwz", "application/vnd.ms-powerpoint" },
  408. { "qht", "text/x-html-insertion" },
  409. { "qhtm", "text/x-html-insertion" },
  410. { "qt", "video/quicktime" },
  411. { "qti", "image/x-quicktime" },
  412. { "qtif", "image/x-quicktime" },
  413. { "qtl", "application/x-quicktimeplayer" },
  414. { "qxd", "application/octet-stream" },
  415. { "ra", "audio/x-pn-realaudio" },
  416. { "ram", "audio/x-pn-realaudio" },
  417. { "rar", { "application/x-rar-compressed", "application/x-rar", "application/rar", "application/octet-stream" } },
  418. { "ras", "image/x-cmu-raster" },
  419. { "rat", "application/rat-file" },
  420. { "rc", "text/plain" },
  421. { "rc2", "text/plain" },
  422. { "rct", "text/plain" },
  423. { "rdlc", "application/xml" },
  424. { "reg", "text/plain" },
  425. { "resx", "application/xml" },
  426. { "rf", "image/vnd.rn-realflash" },
  427. { "rgb", "image/x-rgb" },
  428. { "rgs", "text/plain" },
  429. { "rm", "application/vnd.rn-realmedia" },
  430. { "rmi", "audio/mid" },
  431. { "rmp", "application/vnd.rn-rn_music_package" },
  432. { "roff", "application/x-troff" },
  433. { "rpm", "audio/x-pn-realaudio-plugin" },
  434. { "rqy", "text/x-ms-rqy" },
  435. { "rtf", { "application/rtf", "application/msword", "text/richtext", "text/rtf" } },
  436. { "rtx", "text/richtext" },
  437. { "rvt", "application/octet-stream" },
  438. { "ruleset", "application/xml" },
  439. { "s", "text/plain" },
  440. { "safariextz", "application/x-safari-safariextz" },
  441. { "scd", "application/x-msschedule" },
  442. { "scr", "text/plain" },
  443. { "sct", "text/scriptlet" },
  444. { "sd2", "audio/x-sd2" },
  445. { "sdp", "application/sdp" },
  446. { "sea", "application/octet-stream" },
  447. { "searchConnector-ms", "application/windows-search-connector+xml" },
  448. { "setpay", "application/set-payment-initiation" },
  449. { "setreg", "application/set-registration-initiation" },
  450. { "settings", "application/xml" },
  451. { "sgimb", "application/x-sgimb" },
  452. { "sgml", "text/sgml" },
  453. { "sh", "application/x-sh" },
  454. { "shar", "application/x-shar" },
  455. { "shtml", "text/html" },
  456. { "sit", "application/x-stuffit" },
  457. { "sitemap", "application/xml" },
  458. { "skin", "application/xml" },
  459. { "skp", "application/x-koan" },
  460. { "sldm", "application/vnd.ms-powerpoint.slide.macroEnabled.12" },
  461. { "sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide" },
  462. { "slk", "application/vnd.ms-excel" },
  463. { "sln", "text/plain" },
  464. { "slupkg-ms", "application/x-ms-license" },
  465. { "smd", "audio/x-smd" },
  466. { "smi", "application/octet-stream" },
  467. { "smx", "audio/x-smd" },
  468. { "smz", "audio/x-smd" },
  469. { "snd", "audio/basic" },
  470. { "snippet", "application/xml" },
  471. { "snp", "application/octet-stream" },
  472. { "sol", "text/plain" },
  473. { "sor", "text/plain" },
  474. { "spc", "application/x-pkcs7-certificates" },
  475. { "spl", "application/futuresplash" },
  476. { "spx", "audio/ogg" },
  477. { "src", "application/x-wais-source" },
  478. { "srf", "text/plain" },
  479. { "SSISDeploymentManifest", "text/xml" },
  480. { "ssm", "application/streamingmedia" },
  481. { "sst", "application/vnd.ms-pki.certstore" },
  482. { "stl", "application/vnd.ms-pki.stl" },
  483. { "sv4cpio", "application/x-sv4cpio" },
  484. { "sv4crc", "application/x-sv4crc" },
  485. { "svc", "application/xml" },
  486. { "svg", "image/svg+xml" },
  487. { "swf", "application/x-shockwave-flash" },
  488. { "step", "application/step" },
  489. { "stp", "application/step" },
  490. { "t", "application/x-troff" },
  491. { "tar", "application/x-tar" },
  492. { "tcl", "application/x-tcl" },
  493. { "testrunconfig", "application/xml" },
  494. { "testsettings", "application/xml" },
  495. { "tex", "application/x-tex" },
  496. { "texi", "application/x-texinfo" },
  497. { "texinfo", "application/x-texinfo" },
  498. { "tgz", "application/x-compressed" },
  499. { "thmx", "application/vnd.ms-officetheme" },
  500. { "thn", "application/octet-stream" },
  501. { "tif", { "image/tiff", "application/octet-stream" } },
  502. { "tiff", "image/tiff" },
  503. { "tlh", "text/plain" },
  504. { "tli", "text/plain" },
  505. { "toc", "application/octet-stream" },
  506. { "tr", "application/x-troff" },
  507. { "trm", "application/x-msterminal" },
  508. { "trx", "application/xml" },
  509. { "ts", "video/vnd.dlna.mpeg-tts" },
  510. { "tsv", "text/tab-separated-values" },
  511. { "ttf", "application/font-sfnt" },
  512. { "tts", "video/vnd.dlna.mpeg-tts" },
  513. { "txt", "text/plain" },
  514. { "u32", "application/octet-stream" },
  515. { "uls", "text/iuls" },
  516. { "user", "text/plain" },
  517. { "ustar", "application/x-ustar" },
  518. { "vb", "text/plain" },
  519. { "vbdproj", "text/plain" },
  520. { "vbk", "video/mpeg" },
  521. { "vbproj", "text/plain" },
  522. { "vbs", "text/vbscript" },
  523. { "vcf", { "text/x-vcard", "text/vcard" } },
  524. { "vcproj", "application/xml" },
  525. { "vcs", "text/plain" },
  526. { "vcxproj", "application/xml" },
  527. { "vddproj", "text/plain" },
  528. { "vdp", "text/plain" },
  529. { "vdproj", "text/plain" },
  530. { "vdx", "application/vnd.ms-visio.viewer" },
  531. { "vml", "text/xml" },
  532. { "vscontent", "application/xml" },
  533. { "vsct", "text/xml" },
  534. { "vsd", "application/vnd.visio" },
  535. { "vsi", "application/ms-vsi" },
  536. { "vsix", "application/vsix" },
  537. { "vsixlangpack", "text/xml" },
  538. { "vsixmanifest", "text/xml" },
  539. { "vsmdi", "application/xml" },
  540. { "vspscc", "text/plain" },
  541. { "vss", "application/vnd.visio" },
  542. { "vsscc", "text/plain" },
  543. { "vssettings", "text/xml" },
  544. { "vssscc", "text/plain" },
  545. { "vst", "application/vnd.visio" },
  546. { "vstemplate", "text/xml" },
  547. { "vsto", "application/x-ms-vsto" },
  548. { "vsw", "application/vnd.visio" },
  549. { "vsx", "application/vnd.visio" },
  550. { "vtx", "application/vnd.visio" },
  551. { "wav", { "audio/wav", "audio/vnd.wave", "audio/x-wav" } },
  552. { "wave", "audio/wav" },
  553. { "wax", "audio/x-ms-wax" },
  554. { "wbk", "application/msword" },
  555. { "wbmp", "image/vnd.wap.wbmp" },
  556. { "wcm", "application/vnd.ms-works" },
  557. { "wdb", "application/vnd.ms-works" },
  558. { "wdp", "image/vnd.ms-photo" },
  559. { "webarchive", "application/x-safari-webarchive" },
  560. { "webm", "video/webm" },
  561. { "webp", "image/webp" },
  562. { "webtest", "application/xml" },
  563. { "wiq", "application/xml" },
  564. { "wiz", "application/msword" },
  565. { "wks", "application/vnd.ms-works" },
  566. { "WLMP", "application/wlmoviemaker" },
  567. { "wlpginstall", "application/x-wlpg-detect" },
  568. { "wlpginstall3", "application/x-wlpg3-detect" },
  569. { "wm", "video/x-ms-wm" },
  570. { "wma", "audio/x-ms-wma" },
  571. { "wmd", "application/x-ms-wmd" },
  572. { "wmf", { "application/x-msmetafile", "image/wmf", "image/x-wmf" } },
  573. { "wml", "text/vnd.wap.wml" },
  574. { "wmlc", "application/vnd.wap.wmlc" },
  575. { "wmls", "text/vnd.wap.wmlscript" },
  576. { "wmlsc", "application/vnd.wap.wmlscriptc" },
  577. { "wmp", "video/x-ms-wmp" },
  578. { "wmv", "video/x-ms-wmv" },
  579. { "wmx", "video/x-ms-wmx" },
  580. { "wmz", "application/x-ms-wmz" },
  581. { "woff", "application/font-woff" },
  582. { "wpl", "application/vnd.ms-wpl" },
  583. { "wps", "application/vnd.ms-works" },
  584. { "wri", "application/x-mswrite" },
  585. { "wrl", "x-world/x-vrml" },
  586. { "wrz", "x-world/x-vrml" },
  587. { "wsc", "text/scriptlet" },
  588. { "wsdl", "text/xml" },
  589. { "wvx", "video/x-ms-wvx" },
  590. { "x", "application/directx" },
  591. { "xaf", "x-world/x-vrml" },
  592. { "xaml", "application/xaml+xml" },
  593. { "xap", "application/x-silverlight-app" },
  594. { "xbap", "application/x-ms-xbap" },
  595. { "xbm", "image/x-xbitmap" },
  596. { "xdr", "text/plain" },
  597. { "xht", "application/xhtml+xml" },
  598. { "xhtml", "application/xhtml+xml" },
  599. { "xla", "application/vnd.ms-excel" },
  600. { "xlam", "application/vnd.ms-excel.addin.macroEnabled.12" },
  601. { "xlc", "application/vnd.ms-excel" },
  602. { "xld", "application/vnd.ms-excel" },
  603. { "xlk", "application/vnd.ms-excel" },
  604. { "xll", "application/vnd.ms-excel" },
  605. { "xlm", "application/vnd.ms-excel" },
  606. { "xls", {
  607. "application/excel",
  608. "application/vnd.ms-excel",
  609. "application/vnd.ms-office",
  610. "application/x-excel",
  611. "application/octet-stream"
  612. } },
  613. { "xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12" },
  614. { "xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12" },
  615. { "xlsx", {
  616. "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
  617. "application/vnd.ms-excel.12",
  618. "application/octet-stream"
  619. } },
  620. { "xlt", "application/vnd.ms-excel" },
  621. { "xltm", "application/vnd.ms-excel.template.macroEnabled.12" },
  622. { "xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template" },
  623. { "xlw", "application/vnd.ms-excel" },
  624. { "xml", { "application/xml", "text/xml", "application/octet-stream" } },
  625. { "xmp", "application/octet-stream" },
  626. { "xmta", "application/xml" },
  627. { "xof", "x-world/x-vrml" },
  628. { "XOML", "text/plain" },
  629. { "xpm", "image/x-xpixmap" },
  630. { "xps", "application/vnd.ms-xpsdocument" },
  631. { "xrm-ms", "text/xml" },
  632. { "xsc", "application/xml" },
  633. { "xsd", "text/xml" },
  634. { "xsf", "text/xml" },
  635. { "xsl", "text/xml" },
  636. { "xslt", "text/xml" },
  637. { "xsn", "application/octet-stream" },
  638. { "xss", "application/xml" },
  639. { "xspf", "application/xspf+xml" },
  640. { "xtp", "application/octet-stream" },
  641. { "xwd", "image/x-xwindowdump" },
  642. { "z", "application/x-compress" },
  643. { "zip", {
  644. "application/zip",
  645. "application/x-zip-compressed",
  646. "application/octet-stream"
  647. } },
  648. { "zlib", "application/zlib" },
  649. }
  650. -- Used to match extension by content type
  651. exports.reversed_extensions_map = {
  652. ["text/html"] = "html",
  653. ["text/css"] = "css",
  654. ["text/xml"] = "xml",
  655. ["image/gif"] = "gif",
  656. ["image/jpeg"] = "jpeg",
  657. ["application/javascript"] = "js",
  658. ["application/atom+xml"] = "atom",
  659. ["application/rss+xml"] = "rss",
  660. ["application/csv"] = "csv",
  661. ["text/mathml"] = "mml",
  662. ["text/plain"] = "txt",
  663. ["text/vnd.sun.j2me.app-descriptor"] = "jad",
  664. ["text/vnd.wap.wml"] = "wml",
  665. ["text/x-component"] = "htc",
  666. ["image/png"] = "png",
  667. ["image/svg+xml"] = "svg",
  668. ["image/tiff"] = "tiff",
  669. ["image/vnd.wap.wbmp"] = "wbmp",
  670. ["image/webp"] = "webp",
  671. ["image/x-icon"] = "ico",
  672. ["image/x-jng"] = "jng",
  673. ["image/x-ms-bmp"] = "bmp",
  674. ["font/woff"] = "woff",
  675. ["font/woff2"] = "woff2",
  676. ["application/java-archive"] = "jar",
  677. ["application/json"] = "json",
  678. ["application/mac-binhex40"] = "hqx",
  679. ["application/msword"] = "doc",
  680. ["application/pdf"] = "pdf",
  681. ["application/postscript"] = "ps",
  682. ["application/rtf"] = "rtf",
  683. ["application/vnd.apple.mpegurl"] = "m3u8",
  684. ["application/vnd.google-earth.kml+xml"] = "kml",
  685. ["application/vnd.google-earth.kmz"] = "kmz",
  686. ["application/vnd.ms-excel"] = "xls",
  687. ["application/vnd.ms-fontobject"] = "eot",
  688. ["application/vnd.ms-powerpoint"] = "ppt",
  689. ["application/vnd.oasis.opendocument.graphics"] = "odg",
  690. ["application/vnd.oasis.opendocument.presentation"] = "odp",
  691. ["application/vnd.oasis.opendocument.spreadsheet"] = "ods",
  692. ["application/vnd.oasis.opendocument.text"] = "odt",
  693. ["application/vnd.openxmlformats-officedocument.presentationml.presentation"] = "pptx",
  694. ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"] = "xlsx",
  695. ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"] = "docx",
  696. ["application/x-7z-compressed"] = "7z",
  697. ["application/x-cocoa"] = "cco",
  698. ["application/x-java-archive-diff"] = "jardiff",
  699. ["application/x-java-jnlp-file"] = "jnlp",
  700. ["application/x-makeself"] = "run",
  701. ["application/x-perl"] = "pl",
  702. ["application/x-pilot"] = "pdb",
  703. ["application/x-rar-compressed"] = "rar",
  704. ["application/x-redhat-package-manager"] = "rpm",
  705. ["application/x-sea"] = "sea",
  706. ["application/x-shockwave-flash"] = "swf",
  707. ["application/x-stuffit"] = "sit",
  708. ["application/x-tcl"] = "tcl",
  709. ["application/x-x509-ca-cert"] = "crt",
  710. ["application/x-xpinstall"] = "xpi",
  711. ["application/xhtml+xml"] = "xhtml",
  712. ["application/xspf+xml"] = "xspf",
  713. ["application/zip"] = "zip",
  714. ["application/x-dosexec"] = "exe",
  715. ["application/x-msdownload"] = "exe",
  716. ["application/x-executable"] = "exe",
  717. ["text/x-msdos-batch"] = "bat",
  718. ["audio/midi"] = "mid",
  719. ["audio/mpeg"] = "mp3",
  720. ["audio/ogg"] = "ogg",
  721. ["audio/x-m4a"] = "m4a",
  722. ["audio/x-realaudio"] = "ra",
  723. ["video/3gpp"] = "3gpp",
  724. ["video/mp2t"] = "ts",
  725. ["video/mp4"] = "mp4",
  726. ["video/mpeg"] = "mpeg",
  727. ["video/quicktime"] = "mov",
  728. ["video/webm"] = "webm",
  729. ["video/x-flv"] = "flv",
  730. ["video/x-m4v"] = "m4v",
  731. ["video/x-mng"] = "mng",
  732. ["video/x-ms-asf"] = "asx",
  733. ["video/x-ms-wmv"] = "wmv",
  734. ["video/x-msvideo"] = "avi",
  735. }
  736. return exports