mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-10 18:33:08 +02:00
c36e7d1a07
* enhance(server): downloadUrlでContent-Dispositionからファイル名を取得 Resolve #10036 Resolve #4750 * untitled * オブジェクトストレージのContent-Dispositionのファイル名の拡張子をContent-Typeに添ったものにする * ✌️ * tiff * fix filename * add test * /files/でもContent-Disposition * enhance(server): メディアプロキシでico,bmpを読めるように Fix #10120 * comment * fix test --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
11 lines
869 B
TypeScript
11 lines
869 B
TypeScript
import { FILE_TYPE_BROWSERSAFE } from '@/const.js';
|
|
|
|
const dictionary = {
|
|
'safe-file': FILE_TYPE_BROWSERSAFE,
|
|
'sharp-convertible-image': ['image/jpeg', 'image/png', 'image/gif', 'image/apng', 'image/vnd.mozilla.apng', 'image/webp', 'image/avif', 'image/svg+xml'],
|
|
'sharp-animation-convertible-image': ['image/jpeg', 'image/png', 'image/gif', 'image/webp', 'image/avif', 'image/svg+xml'],
|
|
'sharp-convertible-image-with-bmp': ['image/jpeg', 'image/png', 'image/gif', 'image/apng', 'image/vnd.mozilla.apng', 'image/webp', 'image/avif', 'image/svg+xml', 'image/x-icon', 'image/bmp'],
|
|
'sharp-animation-convertible-image-with-bmp': ['image/jpeg', 'image/png', 'image/gif', 'image/webp', 'image/avif', 'image/svg+xml', 'image/x-icon', 'image/bmp'],
|
|
};
|
|
|
|
export const isMimeImage = (mime: string, type: keyof typeof dictionary): boolean => dictionary[type].includes(mime);
|