Skip to content

Commit

Permalink
Merge pull request #5234 from benjaoming/content-types
Browse files Browse the repository at this point in the history
Add a full set of used content types
  • Loading branch information
benjaoming authored Aug 1, 2016
2 parents 4ff51c1 + 0ca60a0 commit 9e72139
Showing 1 changed file with 95 additions and 2 deletions.
97 changes: 95 additions & 2 deletions kalite/distributed/cherrypyserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,101 @@

__all__ = ['DjangoAppPlugin']

# Due to #5140 (Windows XP doesn't know SVG), we add this...
WELL_KNOWN_CONTENT_TYPES = {'svg': 'svg/xml'}
# Due to #5140 (Windows XP doesn't know SVG), so we had to add this.
# Then because of #5233 we had to add a full mapping of all content types that
# we use.
WELL_KNOWN_CONTENT_TYPES = {
"atom": "application/atom+xml",
"json": "application/json",
"jsonld": "application/ld+json",
"rss": "application/rss+xml",
"geojson": "application/vnd.geo+json",
"rdf": "application/xml",
"js": "application/javascript",
"webmanifest": "application/manifest+json",
"webapp": "application/x-web-app-manifest+json",
"appcache": "text/cache-manifest",
"mid": "audio/midi",
"aac": "audio/mp4",
"mp3": "audio/mpeg",
"oga": "audio/ogg",
"ra": "audio/x-realaudio",
"wav": "audio/x-wav",
"bmp": "image/bmp",
"gif": "image/gif",
"jpeg": "image/jpeg",
"jpg": "image/jpeg",
"png": "image/png",
"svg": "image/svg+xml",
"tif": "image/tiff",
"wbmp": "image/vnd.wap.wbmp",
"webp": "image/webp",
"jng": "image/x-jng",
"3gp": "video/3gpp",
"f4p": "video/mp4",
"mpeg": "video/mpeg",
"ogv": "video/ogg",
"mov": "video/quicktime",
"webm": "video/webm",
"flv": "video/x-flv",
"mng": "video/x-mng",
"asf": "video/x-ms-asf",
"wmv": "video/x-ms-wmv",
"avi": "video/x-msvideo",
"cur": "image/x-icon",
"doc": "application/msword",
"xls": "application/vnd.ms-excel",
"ppt": "application/vnd.ms-powerpoint",
"docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
"woff": "application/font-woff",
"woff2": "application/font-woff2",
"eot": "application/vnd.ms-fontobject",
"ttc": "application/x-font-ttf",
"otf": "font/opentype",
"ear": "application/java-archive",
"hqx": "application/mac-binhex40",
"bin": "application/octet-stream",
"pdf": "application/pdf",
"ai": "application/postscript",
"rtf": "application/rtf",
"kml": "application/vnd.google-earth.kml+xml",
"kmz": "application/vnd.google-earth.kmz",
"wmlc": "application/vnd.wap.wmlc",
"7z": "application/x-7z-compressed",
"bbaw": "application/x-bb-appworld",
"torrent": "application/x-bittorrent",
"crx": "application/x-chrome-extension",
"cco": "application/x-cocoa",
"jardiff": "application/x-java-archive-diff",
"jnlp": "application/x-java-jnlp-file",
"run": "application/x-makeself",
"oex": "application/x-opera-extension",
"pl": "application/x-perl",
"pdb": "application/x-pilot",
"rar": "application/x-rar-compressed",
"rpm": "application/x-redhat-package-manager",
"sea": "application/x-sea",
"swf": "application/x-shockwave-flash",
"sit": "application/x-stuffit",
"tcl": "application/x-tcl",
"crt": "application/x-x509-ca-cert",
"xpi": "application/x-xpinstall",
"xhtml": "application/xhtml+xml",
"xsl": "application/xslt+xml",
"zip": "application/zip",
"css": "text/css",
"htm": "text/html",
"mml": "text/mathml",
"txt": "text/plain",
"vcard": "text/vcard",
"xloc": "text/vnd.rim.location.xloc",
"jad": "text/vnd.sun.j2me.app-descriptor",
"wml": "text/vnd.wap.wml",
"vtt": "text/vtt",
"htc": "text/x-component",
}

class DjangoAppPlugin(plugins.SimplePlugin):
def __init__(self, bus):
Expand Down

0 comments on commit 9e72139

Please sign in to comment.