magnetar/fe_calckey/frontend/client/src/const.ts

46 lines
1.0 KiB
TypeScript
Raw Normal View History

2023-07-07 19:22:30 +00:00
// ブラウザで直接表示することを許可するファイルの種類のリスト
// ここに含まれないものは application/octet-stream としてレスポンスされる
// SVGはXSSを生むので許可しない
export const FILE_TYPE_BROWSERSAFE = [
// Images
"image/png",
"image/gif",
"image/jpeg",
"image/webp",
"image/apng",
"image/bmp",
"image/tiff",
"image/x-icon",
"image/avif",
2023-07-07 19:22:30 +00:00
// OggS
"audio/opus",
"video/ogg",
"audio/ogg",
"application/ogg",
2023-07-07 19:22:30 +00:00
// ISO/IEC base media file format
"video/quicktime",
"video/mp4",
"audio/mp4",
"video/x-m4v",
"audio/x-m4a",
"video/3gpp",
"video/3gpp2",
2023-07-07 19:22:30 +00:00
"video/mpeg",
"audio/mpeg",
2023-07-07 19:22:30 +00:00
"video/webm",
"audio/webm",
2023-07-07 19:22:30 +00:00
"audio/aac",
"audio/x-flac",
"audio/vnd.wave",
2023-07-07 19:22:30 +00:00
];
/*
https://github.com/sindresorhus/file-type/blob/main/supported.js
https://github.com/sindresorhus/file-type/blob/main/core.js
https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers
*/