mime-types.json 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. [
  2. "Basics",
  3. {
  4. "input": "text/html;charset=gbk",
  5. "output": "text/html;charset=gbk",
  6. "navigable": true,
  7. "encoding": "GBK"
  8. },
  9. {
  10. "input": "TEXT/HTML;CHARSET=GBK",
  11. "output": "text/html;charset=GBK",
  12. "navigable": true,
  13. "encoding": "GBK"
  14. },
  15. "Legacy comment syntax",
  16. {
  17. "input": "text/html;charset=gbk(",
  18. "output": "text/html;charset=\"gbk(\"",
  19. "navigable": true,
  20. "encoding": null
  21. },
  22. {
  23. "input": "text/html;x=(;charset=gbk",
  24. "output": "text/html;x=\"(\";charset=gbk",
  25. "navigable": true,
  26. "encoding": "GBK"
  27. },
  28. "Duplicate parameter",
  29. {
  30. "input": "text/html;charset=gbk;charset=windows-1255",
  31. "output": "text/html;charset=gbk",
  32. "navigable": true,
  33. "encoding": "GBK"
  34. },
  35. {
  36. "input": "text/html;charset=();charset=GBK",
  37. "output": "text/html;charset=\"()\"",
  38. "navigable": true,
  39. "encoding": null
  40. },
  41. "Spaces",
  42. {
  43. "input": "text/html;charset =gbk",
  44. "output": "text/html",
  45. "navigable": true,
  46. "encoding": null
  47. },
  48. {
  49. "input": "text/html ;charset=gbk",
  50. "output": "text/html;charset=gbk",
  51. "navigable": true,
  52. "encoding": "GBK"
  53. },
  54. {
  55. "input": "text/html; charset=gbk",
  56. "output": "text/html;charset=gbk",
  57. "navigable": true,
  58. "encoding": "GBK"
  59. },
  60. {
  61. "input": "text/html;charset= gbk",
  62. "output": "text/html;charset=\" gbk\"",
  63. "navigable": true,
  64. "encoding": "GBK"
  65. },
  66. {
  67. "input": "text/html;charset= \"gbk\"",
  68. "output": "text/html;charset=\" \\\"gbk\\\"\"",
  69. "navigable": true,
  70. "encoding": null
  71. },
  72. "0x0B and 0x0C",
  73. {
  74. "input": "text/html;charset=\u000Bgbk",
  75. "output": "text/html",
  76. "navigable": true,
  77. "encoding": null
  78. },
  79. {
  80. "input": "text/html;charset=\u000Cgbk",
  81. "output": "text/html",
  82. "navigable": true,
  83. "encoding": null
  84. },
  85. {
  86. "input": "text/html;\u000Bcharset=gbk",
  87. "output": "text/html",
  88. "navigable": true,
  89. "encoding": null
  90. },
  91. {
  92. "input": "text/html;\u000Ccharset=gbk",
  93. "output": "text/html",
  94. "navigable": true,
  95. "encoding": null
  96. },
  97. "Single quotes are a token, not a delimiter",
  98. {
  99. "input": "text/html;charset='gbk'",
  100. "output": "text/html;charset='gbk'",
  101. "navigable": true,
  102. "encoding": null
  103. },
  104. {
  105. "input": "text/html;charset='gbk",
  106. "output": "text/html;charset='gbk",
  107. "navigable": true,
  108. "encoding": null
  109. },
  110. {
  111. "input": "text/html;charset=gbk'",
  112. "output": "text/html;charset=gbk'",
  113. "navigable": true,
  114. "encoding": null
  115. },
  116. {
  117. "input": "text/html;charset=';charset=GBK",
  118. "output": "text/html;charset='",
  119. "navigable": true,
  120. "encoding": null
  121. },
  122. "Invalid parameters",
  123. {
  124. "input": "text/html;test;charset=gbk",
  125. "output": "text/html;charset=gbk",
  126. "navigable": true,
  127. "encoding": "GBK"
  128. },
  129. {
  130. "input": "text/html;test=;charset=gbk",
  131. "output": "text/html;charset=gbk",
  132. "navigable": true,
  133. "encoding": "GBK"
  134. },
  135. {
  136. "input": "text/html;';charset=gbk",
  137. "output": "text/html;charset=gbk",
  138. "navigable": true,
  139. "encoding": "GBK"
  140. },
  141. {
  142. "input": "text/html;\";charset=gbk",
  143. "output": "text/html;charset=gbk",
  144. "navigable": true,
  145. "encoding": "GBK"
  146. },
  147. {
  148. "input": "text/html ; ; charset=gbk",
  149. "output": "text/html;charset=gbk",
  150. "navigable": true,
  151. "encoding": "GBK"
  152. },
  153. {
  154. "input": "text/html;;;;charset=gbk",
  155. "output": "text/html;charset=gbk",
  156. "navigable": true,
  157. "encoding": "GBK"
  158. },
  159. {
  160. "input": "text/html;charset= \"\u007F;charset=GBK",
  161. "output": "text/html;charset=GBK",
  162. "navigable": true,
  163. "encoding": "GBK"
  164. },
  165. {
  166. "input": "text/html;charset=\"\u007F;charset=foo\";charset=GBK",
  167. "output": "text/html;charset=GBK",
  168. "navigable": true,
  169. "encoding": "GBK"
  170. },
  171. "Double quotes",
  172. {
  173. "input": "text/html;charset=\"gbk\"",
  174. "output": "text/html;charset=gbk",
  175. "navigable": true,
  176. "encoding": "GBK"
  177. },
  178. {
  179. "input": "text/html;charset=\"gbk",
  180. "output": "text/html;charset=gbk",
  181. "navigable": true,
  182. "encoding": "GBK"
  183. },
  184. {
  185. "input": "text/html;charset=gbk\"",
  186. "output": "text/html;charset=\"gbk\\\"\"",
  187. "navigable": true,
  188. "encoding": null
  189. },
  190. {
  191. "input": "text/html;charset=\" gbk\"",
  192. "output": "text/html;charset=\" gbk\"",
  193. "navigable": true,
  194. "encoding": "GBK"
  195. },
  196. {
  197. "input": "text/html;charset=\"gbk \"",
  198. "output": "text/html;charset=\"gbk \"",
  199. "navigable": true,
  200. "encoding": "GBK"
  201. },
  202. {
  203. "input": "text/html;charset=\"\\ gbk\"",
  204. "output": "text/html;charset=\" gbk\"",
  205. "navigable": true,
  206. "encoding": "GBK"
  207. },
  208. {
  209. "input": "text/html;charset=\"\\g\\b\\k\"",
  210. "output": "text/html;charset=gbk",
  211. "navigable": true,
  212. "encoding": "GBK"
  213. },
  214. {
  215. "input": "text/html;charset=\"gbk\"x",
  216. "output": "text/html;charset=gbk",
  217. "navigable": true,
  218. "encoding": "GBK"
  219. },
  220. {
  221. "input": "text/html;charset=\"\";charset=GBK",
  222. "output": "text/html;charset=\"\"",
  223. "navigable": true,
  224. "encoding": null
  225. },
  226. {
  227. "input": "text/html;charset=\";charset=GBK",
  228. "output": "text/html;charset=\";charset=GBK\"",
  229. "navigable": true,
  230. "encoding": null
  231. },
  232. "Unexpected code points",
  233. {
  234. "input": "text/html;charset={gbk}",
  235. "output": "text/html;charset=\"{gbk}\"",
  236. "navigable": true,
  237. "encoding": null
  238. },
  239. "Parameter name longer than 127",
  240. {
  241. "input": "text/html;0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789=x;charset=gbk",
  242. "output": "text/html;0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789=x;charset=gbk",
  243. "navigable": true,
  244. "encoding": "GBK"
  245. },
  246. "type/subtype longer than 127",
  247. {
  248. "input": "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789/0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
  249. "output": "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789/0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
  250. },
  251. "Invalid names",
  252. {
  253. "input": "text/html;a]=bar;b[=bar;c=bar",
  254. "output": "text/html;c=bar"
  255. },
  256. "Semicolons in value",
  257. {
  258. "input": "text/html;valid=\";\";foo=bar",
  259. "output": "text/html;valid=\";\";foo=bar"
  260. },
  261. {
  262. "input": "text/html;in]valid=\";asd=foo\";foo=bar",
  263. "output": "text/html;foo=bar"
  264. },
  265. "Valid",
  266. {
  267. "input": "!#$%&'*+-.^_`|~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz/!#$%&'*+-.^_`|~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz;!#$%&'*+-.^_`|~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz=!#$%&'*+-.^_`|~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
  268. "output": "!#$%&'*+-.^_`|~0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz/!#$%&'*+-.^_`|~0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz;!#$%&'*+-.^_`|~0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz=!#$%&'*+-.^_`|~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
  269. },
  270. {
  271. "input": "x/x;x=\"\t !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0080\u0081\u0082\u0083\u0084\u0085\u0086\u0087\u0088\u0089\u008A\u008B\u008C\u008D\u008E\u008F\u0090\u0091\u0092\u0093\u0094\u0095\u0096\u0097\u0098\u0099\u009A\u009B\u009C\u009D\u009E\u009F\u00A0\u00A1\u00A2\u00A3\u00A4\u00A5\u00A6\u00A7\u00A8\u00A9\u00AA\u00AB\u00AC\u00AD\u00AE\u00AF\u00B0\u00B1\u00B2\u00B3\u00B4\u00B5\u00B6\u00B7\u00B8\u00B9\u00BA\u00BB\u00BC\u00BD\u00BE\u00BF\u00C0\u00C1\u00C2\u00C3\u00C4\u00C5\u00C6\u00C7\u00C8\u00C9\u00CA\u00CB\u00CC\u00CD\u00CE\u00CF\u00D0\u00D1\u00D2\u00D3\u00D4\u00D5\u00D6\u00D7\u00D8\u00D9\u00DA\u00DB\u00DC\u00DD\u00DE\u00DF\u00E0\u00E1\u00E2\u00E3\u00E4\u00E5\u00E6\u00E7\u00E8\u00E9\u00EA\u00EB\u00EC\u00ED\u00EE\u00EF\u00F0\u00F1\u00F2\u00F3\u00F4\u00F5\u00F6\u00F7\u00F8\u00F9\u00FA\u00FB\u00FC\u00FD\u00FE\u00FF\"",
  272. "output": "x/x;x=\"\t !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0080\u0081\u0082\u0083\u0084\u0085\u0086\u0087\u0088\u0089\u008A\u008B\u008C\u008D\u008E\u008F\u0090\u0091\u0092\u0093\u0094\u0095\u0096\u0097\u0098\u0099\u009A\u009B\u009C\u009D\u009E\u009F\u00A0\u00A1\u00A2\u00A3\u00A4\u00A5\u00A6\u00A7\u00A8\u00A9\u00AA\u00AB\u00AC\u00AD\u00AE\u00AF\u00B0\u00B1\u00B2\u00B3\u00B4\u00B5\u00B6\u00B7\u00B8\u00B9\u00BA\u00BB\u00BC\u00BD\u00BE\u00BF\u00C0\u00C1\u00C2\u00C3\u00C4\u00C5\u00C6\u00C7\u00C8\u00C9\u00CA\u00CB\u00CC\u00CD\u00CE\u00CF\u00D0\u00D1\u00D2\u00D3\u00D4\u00D5\u00D6\u00D7\u00D8\u00D9\u00DA\u00DB\u00DC\u00DD\u00DE\u00DF\u00E0\u00E1\u00E2\u00E3\u00E4\u00E5\u00E6\u00E7\u00E8\u00E9\u00EA\u00EB\u00EC\u00ED\u00EE\u00EF\u00F0\u00F1\u00F2\u00F3\u00F4\u00F5\u00F6\u00F7\u00F8\u00F9\u00FA\u00FB\u00FC\u00FD\u00FE\u00FF\""
  273. },
  274. "End-of-file handling",
  275. {
  276. "input": "x/x;test",
  277. "output": "x/x"
  278. },
  279. {
  280. "input": "x/x;test=\"\\",
  281. "output": "x/x;test=\"\\\\\""
  282. },
  283. "Whitespace (not handled by generated-mime-types.json or above)",
  284. {
  285. "input": "x/x;x= ",
  286. "output": "x/x"
  287. },
  288. {
  289. "input": "x/x;x=\t",
  290. "output": "x/x"
  291. },
  292. {
  293. "input": "x/x\n\r\t ;x=x",
  294. "output": "x/x;x=x"
  295. },
  296. {
  297. "input": "\n\r\t x/x;x=x\n\r\t ",
  298. "output": "x/x;x=x"
  299. },
  300. {
  301. "input": "x/x;\n\r\t x=x\n\r\t ;x=y",
  302. "output": "x/x;x=x"
  303. },
  304. "Latin1",
  305. {
  306. "input": "text/html;test=\u00FF;charset=gbk",
  307. "output": "text/html;test=\"\u00FF\";charset=gbk",
  308. "navigable": true,
  309. "encoding": "GBK"
  310. },
  311. ">Latin1",
  312. {
  313. "input": "x/x;test=\uFFFD;x=x",
  314. "output": "x/x;x=x"
  315. },
  316. "Failure",
  317. {
  318. "input": "\u000Bx/x",
  319. "output": null
  320. },
  321. {
  322. "input": "\u000Cx/x",
  323. "output": null
  324. },
  325. {
  326. "input": "x/x\u000B",
  327. "output": null
  328. },
  329. {
  330. "input": "x/x\u000C",
  331. "output": null
  332. },
  333. {
  334. "input": "",
  335. "output": null
  336. },
  337. {
  338. "input": "\t",
  339. "output": null
  340. },
  341. {
  342. "input": "/",
  343. "output": null
  344. },
  345. {
  346. "input": "bogus",
  347. "output": null
  348. },
  349. {
  350. "input": "bogus/",
  351. "output": null
  352. },
  353. {
  354. "input": "bogus/ ",
  355. "output": null
  356. },
  357. {
  358. "input": "bogus/bogus/;",
  359. "output": null
  360. },
  361. {
  362. "input": "</>",
  363. "output": null
  364. },
  365. {
  366. "input": "(/)",
  367. "output": null
  368. },
  369. {
  370. "input": "ÿ/ÿ",
  371. "output": null
  372. },
  373. {
  374. "input": "text/html(;doesnot=matter",
  375. "output": null
  376. },
  377. {
  378. "input": "{/}",
  379. "output": null
  380. },
  381. {
  382. "input": "\u0100/\u0100",
  383. "output": null
  384. },
  385. {
  386. "input": "text /html",
  387. "output": null
  388. },
  389. {
  390. "input": "text/ html",
  391. "output": null
  392. },
  393. {
  394. "input": "\"text/html\"",
  395. "output": null
  396. }
  397. ]