From 154e418c3413882014c61fbf5e9462629ad4a6da Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 26 Dec 2021 12:10:33 +0900 Subject: [PATCH] Update const.ts --- packages/backend/src/const.ts | 42 +++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/packages/backend/src/const.ts b/packages/backend/src/const.ts index 59d7206e0..b00bd8165 100644 --- a/packages/backend/src/const.ts +++ b/packages/backend/src/const.ts @@ -5,6 +5,7 @@ export const USER_ACTIVE_THRESHOLD = 1000 * 60 * 60 * 24 * 3; // 3days // ここに含まれないものは application/octet-stream としてレスポンスされる // SVGはXSSを生むので許可しない export const FILE_TYPE_BROWSERSAFE = [ + // Images 'image/png', 'image/gif', 'image/jpeg', @@ -13,21 +14,34 @@ export const FILE_TYPE_BROWSERSAFE = [ 'image/bmp', 'image/tiff', 'image/x-icon', - 'video/mpeg', - 'video/mp4', - 'video/mp2t', - 'video/webm', + + // OggS + 'audio/opus', 'video/ogg', - 'video/3gpp', - 'video/quicktime', - 'video/x-m4v', - 'video/x-msvideo', - 'audio/mpeg', - 'audio/aac', - 'audio/wav', - 'audio/webm', 'audio/ogg', - 'audio/x-m4a', - 'audio/x-flac', 'application/ogg', + + // ISO/IEC base media file format + 'video/quicktime', + 'video/mp4', + 'audio/mp4', + 'video/x-m4v', + 'audio/x-m4a', + 'video/3gpp', + 'video/3gpp2', + + 'video/mpeg', + 'audio/mpeg', + + 'video/webm', + 'audio/webm', + + 'audio/aac', + 'audio/x-flac', + 'audio/vnd.wave', ]; +/* +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 +*/