Skip to content

Commit 9e72139

Browse files
authored
Merge pull request #5234 from benjaoming/content-types
Add a full set of used content types
2 parents 4ff51c1 + 0ca60a0 commit 9e72139

File tree

1 file changed

+95
-2
lines changed

1 file changed

+95
-2
lines changed

kalite/distributed/cherrypyserver.py

Lines changed: 95 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,101 @@
1212

1313
__all__ = ['DjangoAppPlugin']
1414

15-
# Due to #5140 (Windows XP doesn't know SVG), we add this...
16-
WELL_KNOWN_CONTENT_TYPES = {'svg': 'svg/xml'}
15+
# Due to #5140 (Windows XP doesn't know SVG), so we had to add this.
16+
# Then because of #5233 we had to add a full mapping of all content types that
17+
# we use.
18+
WELL_KNOWN_CONTENT_TYPES = {
19+
"atom": "application/atom+xml",
20+
"json": "application/json",
21+
"jsonld": "application/ld+json",
22+
"rss": "application/rss+xml",
23+
"geojson": "application/vnd.geo+json",
24+
"rdf": "application/xml",
25+
"js": "application/javascript",
26+
"webmanifest": "application/manifest+json",
27+
"webapp": "application/x-web-app-manifest+json",
28+
"appcache": "text/cache-manifest",
29+
"mid": "audio/midi",
30+
"aac": "audio/mp4",
31+
"mp3": "audio/mpeg",
32+
"oga": "audio/ogg",
33+
"ra": "audio/x-realaudio",
34+
"wav": "audio/x-wav",
35+
"bmp": "image/bmp",
36+
"gif": "image/gif",
37+
"jpeg": "image/jpeg",
38+
"jpg": "image/jpeg",
39+
"png": "image/png",
40+
"svg": "image/svg+xml",
41+
"tif": "image/tiff",
42+
"wbmp": "image/vnd.wap.wbmp",
43+
"webp": "image/webp",
44+
"jng": "image/x-jng",
45+
"3gp": "video/3gpp",
46+
"f4p": "video/mp4",
47+
"mpeg": "video/mpeg",
48+
"ogv": "video/ogg",
49+
"mov": "video/quicktime",
50+
"webm": "video/webm",
51+
"flv": "video/x-flv",
52+
"mng": "video/x-mng",
53+
"asf": "video/x-ms-asf",
54+
"wmv": "video/x-ms-wmv",
55+
"avi": "video/x-msvideo",
56+
"cur": "image/x-icon",
57+
"doc": "application/msword",
58+
"xls": "application/vnd.ms-excel",
59+
"ppt": "application/vnd.ms-powerpoint",
60+
"docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
61+
"xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
62+
"pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
63+
"woff": "application/font-woff",
64+
"woff2": "application/font-woff2",
65+
"eot": "application/vnd.ms-fontobject",
66+
"ttc": "application/x-font-ttf",
67+
"otf": "font/opentype",
68+
"ear": "application/java-archive",
69+
"hqx": "application/mac-binhex40",
70+
"bin": "application/octet-stream",
71+
"pdf": "application/pdf",
72+
"ai": "application/postscript",
73+
"rtf": "application/rtf",
74+
"kml": "application/vnd.google-earth.kml+xml",
75+
"kmz": "application/vnd.google-earth.kmz",
76+
"wmlc": "application/vnd.wap.wmlc",
77+
"7z": "application/x-7z-compressed",
78+
"bbaw": "application/x-bb-appworld",
79+
"torrent": "application/x-bittorrent",
80+
"crx": "application/x-chrome-extension",
81+
"cco": "application/x-cocoa",
82+
"jardiff": "application/x-java-archive-diff",
83+
"jnlp": "application/x-java-jnlp-file",
84+
"run": "application/x-makeself",
85+
"oex": "application/x-opera-extension",
86+
"pl": "application/x-perl",
87+
"pdb": "application/x-pilot",
88+
"rar": "application/x-rar-compressed",
89+
"rpm": "application/x-redhat-package-manager",
90+
"sea": "application/x-sea",
91+
"swf": "application/x-shockwave-flash",
92+
"sit": "application/x-stuffit",
93+
"tcl": "application/x-tcl",
94+
"crt": "application/x-x509-ca-cert",
95+
"xpi": "application/x-xpinstall",
96+
"xhtml": "application/xhtml+xml",
97+
"xsl": "application/xslt+xml",
98+
"zip": "application/zip",
99+
"css": "text/css",
100+
"htm": "text/html",
101+
"mml": "text/mathml",
102+
"txt": "text/plain",
103+
"vcard": "text/vcard",
104+
"xloc": "text/vnd.rim.location.xloc",
105+
"jad": "text/vnd.sun.j2me.app-descriptor",
106+
"wml": "text/vnd.wap.wml",
107+
"vtt": "text/vtt",
108+
"htc": "text/x-component",
109+
}
17110

18111
class DjangoAppPlugin(plugins.SimplePlugin):
19112
def __init__(self, bus):

0 commit comments

Comments
 (0)