2022-01-26 15:08:48 +00:00
|
|
|
// ブラウザで直接表示することを許可するファイルの種類のリスト
|
|
|
|
// ここに含まれないものは application/octet-stream としてレスポンスされる
|
|
|
|
// SVGはXSSを生むので許可しない
|
|
|
|
export const FILE_TYPE_BROWSERSAFE = [
|
|
|
|
// Images
|
2023-01-13 04:40:33 +00:00
|
|
|
"image/png",
|
|
|
|
"image/gif",
|
|
|
|
"image/jpeg",
|
|
|
|
"image/webp",
|
|
|
|
"image/apng",
|
|
|
|
"image/bmp",
|
|
|
|
"image/tiff",
|
|
|
|
"image/x-icon",
|
|
|
|
"image/avif",
|
2022-01-26 15:08:48 +00:00
|
|
|
|
|
|
|
// OggS
|
2023-01-13 04:40:33 +00:00
|
|
|
"audio/opus",
|
|
|
|
"video/ogg",
|
|
|
|
"audio/ogg",
|
|
|
|
"application/ogg",
|
2022-01-26 15:08:48 +00:00
|
|
|
|
|
|
|
// ISO/IEC base media file format
|
2023-01-13 04:40:33 +00:00
|
|
|
"video/quicktime",
|
|
|
|
"video/mp4",
|
|
|
|
"audio/mp4",
|
|
|
|
"video/x-m4v",
|
|
|
|
"audio/x-m4a",
|
|
|
|
"video/3gpp",
|
|
|
|
"video/3gpp2",
|
2022-01-26 15:08:48 +00:00
|
|
|
|
2023-01-13 04:40:33 +00:00
|
|
|
"video/mpeg",
|
|
|
|
"audio/mpeg",
|
2022-01-26 15:08:48 +00:00
|
|
|
|
2023-01-13 04:40:33 +00:00
|
|
|
"video/webm",
|
|
|
|
"audio/webm",
|
2022-01-26 15:08:48 +00:00
|
|
|
|
2023-01-13 04:40:33 +00:00
|
|
|
"audio/aac",
|
|
|
|
"audio/x-flac",
|
|
|
|
"audio/vnd.wave",
|
2022-01-26 15:08:48 +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
|
|
|
|
*/
|