-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add shareable extension-to-MIME-type mapping (#1355)
## What is this PR doing? This PR switches from a hard-coded MIME type list to a JSON based extention-to-MIME-type mapping. ## What problem is it solving? PHPRequestHandler and the WP Cloud PHP request handler use different MIME type mappings. ## How is the problem addressed? This PR adds a JSON file that can be used by both. Both lists contained file extensions the other did not, so the new mapping combines both. GitHub co-pilot was handy for: - quickly converting the existing MIME type switch statement to JSON - sorting and removing duplicate keys from the combined mapping in JSON The WP Cloud PHP request handler will be updated to use the mapping JSON in a separate PR. ## Testing Instructions - Smoke test Playground locally - Make sure e2e tests pass
- Loading branch information
1 parent
784e807
commit 9b2debf
Showing
2 changed files
with
99 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
{ | ||
"_default": "application-octet-stream", | ||
"3gpp": "video/3gpp", | ||
"7z": "application/x-7z-compressed", | ||
"asx": "video/x-ms-asf", | ||
"atom": "application/atom+xml", | ||
"avi": "video/x-msvideo", | ||
"avif": "image/avif", | ||
"bin": "application/octet-stream", | ||
"bmp": "image/x-ms-bmp", | ||
"cco": "application/x-cocoa", | ||
"css": "text/css", | ||
"data": "application/octet-stream", | ||
"deb": "application/octet-stream", | ||
"der": "application/x-x509-ca-cert", | ||
"dmg": "application/octet-stream", | ||
"doc": "application/msword", | ||
"docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", | ||
"eot": "application/vnd.ms-fontobject", | ||
"flv": "video/x-flv", | ||
"gif": "image/gif", | ||
"gz": "application/gzip", | ||
"hqx": "application/mac-binhex40", | ||
"htc": "text/x-component", | ||
"html": "text/html", | ||
"ico": "image/x-icon", | ||
"iso": "application/octet-stream", | ||
"jad": "text/vnd.sun.j2me.app-descriptor", | ||
"jar": "application/java-archive", | ||
"jardiff": "application/x-java-archive-diff", | ||
"jng": "image/x-jng", | ||
"jnlp": "application/x-java-jnlp-file", | ||
"jpg": "image/jpeg", | ||
"jpeg": "image/jpeg", | ||
"js": "application/javascript", | ||
"json": "application/json", | ||
"kml": "application/vnd.google-earth.kml+xml", | ||
"kmz": "application/vnd.google-earth.kmz", | ||
"m3u8": "application/vnd.apple.mpegurl", | ||
"m4a": "audio/x-m4a", | ||
"m4v": "video/x-m4v", | ||
"md": "text/plain", | ||
"mid": "audio/midi", | ||
"mml": "text/mathml", | ||
"mng": "video/x-mng", | ||
"mov": "video/quicktime", | ||
"mp3": "audio/mpeg", | ||
"mp4": "video/mp4", | ||
"mpeg": "video/mpeg", | ||
"msi": "application/octet-stream", | ||
"odg": "application/vnd.oasis.opendocument.graphics", | ||
"odp": "application/vnd.oasis.opendocument.presentation", | ||
"ods": "application/vnd.oasis.opendocument.spreadsheet", | ||
"odt": "application/vnd.oasis.opendocument.text", | ||
"ogg": "audio/ogg", | ||
"otf": "font/otf", | ||
"pdf": "application/pdf", | ||
"pl": "application/x-perl", | ||
"png": "image/png", | ||
"ppt": "application/vnd.ms-powerpoint", | ||
"pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation", | ||
"prc": "application/x-pilot", | ||
"ps": "application/postscript", | ||
"ra": "audio/x-realaudio", | ||
"rar": "application/x-rar-compressed", | ||
"rpm": "application/x-redhat-package-manager", | ||
"rss": "application/rss+xml", | ||
"rtf": "application/rtf", | ||
"run": "application/x-makeself", | ||
"sea": "application/x-sea", | ||
"sit": "application/x-stuffit", | ||
"svg": "image/svg+xml", | ||
"swf": "application/x-shockwave-flash", | ||
"tcl": "application/x-tcl", | ||
"tar": "application/x-tar", | ||
"tif": "image/tiff", | ||
"ts": "video/mp2t", | ||
"ttf": "font/ttf", | ||
"txt": "text/plain", | ||
"wasm": "application/wasm", | ||
"wbmp": "image/vnd.wap.wbmp", | ||
"webm": "video/webm", | ||
"webp": "image/webp", | ||
"wml": "text/vnd.wap.wml", | ||
"wmlc": "application/vnd.wap.wmlc", | ||
"wmv": "video/x-ms-wmv", | ||
"woff": "font/woff", | ||
"woff2": "font/woff2", | ||
"xhtml": "application/xhtml+xml", | ||
"xls": "application/vnd.ms-excel", | ||
"xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", | ||
"xml": "text/xml", | ||
"xpi": "application/x-xpinstall", | ||
"xspf": "application/xspf+xml", | ||
"zip": "application/zip" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters