补全mime-types

v2
yutent 2023-10-31 12:44:51 +08:00
parent a2a6ea850a
commit 13a837a285
1 changed files with 38 additions and 15 deletions

View File

@ -1,41 +1,66 @@
// //
export const CHARSET_TYPES = { export const CHARSET_TYPES = {
html:1, html: 1,
txt:1, txt: 1,
css:1, css: 1,
scss:1, scss: 1,
xml:1, xml: 1,
js:1, js: 1,
json: 1,webmanifest:1 json: 1,
webmanifest: 1
} }
export const MIME_TYPES = { export const MIME_TYPES = {
html: 'text/html', html: 'text/html',
xml: 'text/xml',
txt: 'text/plain', txt: 'text/plain',
css: 'text/css', css: 'text/css',
xml: 'text/xml', js: 'application/javascript',
json: 'application/json',
webmanifest: 'application/json',
wast: 'application/wast',
wasm: 'application/wasm',
gif: 'image/gif', gif: 'image/gif',
jpg: 'image/jpeg', jpg: 'image/jpeg',
webp: 'image/webp', webp: 'image/webp',
tiff: 'image/tiff', tiff: 'image/tiff',
png: 'image/png', png: 'image/png',
apng: 'image/apng',
svg: 'image/svg+xml', svg: 'image/svg+xml',
ico: 'image/x-icon', ico: 'image/x-icon',
bmp: 'image/x-ms-bmp', bmp: 'image/x-ms-bmp',
js: 'application/javascript',
json: 'application/json', mid: 'audio/midi',
webmanifest: 'application/json', midi: 'audio/x-midi',
mp3: 'audio/mpeg', mp3: 'audio/mpeg',
ogg: 'audio/ogg', ogg: 'audio/ogg',
m4a: 'audio/x-m4a', m4a: 'audio/x-m4a',
mp4: 'video/mp4', mp4: 'video/mp4',
webm: 'video/webm', webm: 'video/webm',
ttf: 'font/font-ttf', ttf: 'font/font-ttf',
woff: 'font/font-woff', woff: 'font/font-woff',
woff2: 'font/font-woff2', woff2: 'font/font-woff2',
wast: 'application/wast',
wasm: 'application/wasm', zip: 'application/zip',
'7zip': 'application/zip',
rar: 'application/rar',
gz: 'application/x-gzip',
tar: 'application/x-tar',
tgz: 'application/x-tar',
pdf: 'application/pdf',
psd: 'application/x-photoshop',
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',
stream: 'application/octet-stream' stream: 'application/octet-stream'
} }
@ -44,5 +69,3 @@ MIME_TYPES.scss = MIME_TYPES.css
MIME_TYPES.htm = MIME_TYPES.html MIME_TYPES.htm = MIME_TYPES.html
MIME_TYPES.jpeg = MIME_TYPES.jpg MIME_TYPES.jpeg = MIME_TYPES.jpg
MIME_TYPES.tif = MIME_TYPES.tiff MIME_TYPES.tif = MIME_TYPES.tiff