From 37c9df44fb5c1b04c4d26a4275a6c213b713a959 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Sat, 2 Sep 2023 15:47:02 -1000 Subject: [PATCH] :) --- utils/mime.ts | 329 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 316 insertions(+), 13 deletions(-) diff --git a/utils/mime.ts b/utils/mime.ts index 26befc4..188daa8 100644 --- a/utils/mime.ts +++ b/utils/mime.ts @@ -1,29 +1,332 @@ // https://github.com/cinnyapp/cinny/blob/dev/src/util/mimetypes.js export const ALLOWED_BLOB_MIMETYPES = [ - "image/jpeg", - "image/gif", - "image/png", + "image/aces", "image/apng", - "image/webp", + "image/avci", + "image/avcs", "image/avif", + "image/bmp", + "image/cgm", + "image/dicom-rle", + "image/dpx", + "image/emf", + "image/example", + "image/fits", + "image/g3fax", + "image/heic", + "image/heic-sequence", + "image/heif", + "image/heif-sequence", + "image/hej2k", + "image/hsj2", + "image/j2c", + "image/jls", + "image/jp2", + "image/jph", + "image/jphc", + "image/jpm", + "image/jpx", + "image/jxr", + "image/jxrA", + "image/jxrS", + "image/jxs", + "image/jxsc", + "image/jxsi", + "image/jxss", + "image/ktx", + "image/ktx2", + "image/naplps", + "image/png", + "image/prs.btif", + "image/prs.pti", + "image/pwg-raster", + "image/svg+xml", + "image/t38", + "image/tiff", + "image/tiff-fx", + "image/vnd.adobe.photoshop", + "image/vnd.airzip.accelerator.azv", + "image/vnd.cns.inf2", + "image/vnd.dece.graphic", + "image/vnd.djvu", + "image/vnd.dwg", + "image/vnd.dxf", + "image/vnd.dvb.subtitle", + "image/vnd.fastbidsheet", + "image/vnd.fpx", + "image/vnd.fst", + "image/vnd.fujixerox.edmics-mmr", + "image/vnd.fujixerox.edmics-rlc", + "image/vnd.globalgraphics.pgb", + "image/vnd.microsoft.icon", + "image/vnd.mix", + "image/vnd.ms-modi", + "image/vnd.mozilla.apng", + "image/vnd.net-fpx", + "image/vnd.pco.b16", + "image/vnd.radiance", + "image/vnd.sealed.png", + "image/vnd.sealedmedia.softseal.gif", + "image/vnd.sealedmedia.softseal.jpg", + "image/vnd.svf", + "image/vnd.tencent.tap", + "image/vnd.valve.source.texture", + "image/vnd.wap.wbmp", + "image/vnd.xiff", + "image/vnd.zbrush.pcx", + "image/webp", + "image/wmf", + "image/emf", + "image/wmf", + "video/1d-interleaved-parityfec", + "video/3gpp", + "video/3gpp2", + "video/3gpp-tt", + "video/AV1", + "video/BMPEG", + "video/BT656", + "video/CelB", + "video/DV", + "video/encaprtp", + "video/example", + "video/FFV1", + "video/flexfec", + "video/H261", + "video/H263", + "video/H263-1998", + "video/H263-2000", + "video/H264", + "video/H264-RCDO", + "video/H264-SVC", + "video/H265", + "video/H266", + "video/iso.segment", + "video/JPEG", + "video/jpeg2000", + "video/jxsv", + "video/mj2", + "video/MP1S", + "video/MP2P", + "video/MP2T", "video/mp4", - "video/webm", + "video/MP4V-ES", + "video/MPV", + "video/mpeg4-generic", + "video/nv", "video/ogg", + "video/parityfec", + "video/pointer", "video/quicktime", + "video/raptorfec", + "video/raw", + "video/rtp-enc-aescm128", + "video/rtploopback", + "video/rtx", + "video/scip", + "video/smpte291", + "video/SMPTE292M", + "video/ulpfec", + "video/vc1", + "video/vc2", + "video/vnd.CCTV", + "video/vnd.dece.hd", + "video/vnd.dece.mobile", + "video/vnd.dece.mp4", + "video/vnd.dece.pd", + "video/vnd.dece.sd", + "video/vnd.dece.video", + "video/vnd.directv.mpeg", + "video/vnd.directv.mpeg-tts", + "video/vnd.dlna.mpeg-tts", + "video/vnd.dvb.file", + "video/vnd.fvt", + "video/vnd.hns.video", + "video/vnd.iptvforum.1dparityfec-1010", + "video/vnd.iptvforum.1dparityfec-2005", + "video/vnd.iptvforum.2dparityfec-1010", + "video/vnd.iptvforum.2dparityfec-2005", + "video/vnd.iptvforum.ttsavc", + "video/vnd.iptvforum.ttsmpeg2", + "video/vnd.motorola.video", + "video/vnd.motorola.videop", + "video/vnd.mpegurl", + "video/vnd.ms-playready.media.pyv", + "video/vnd.nokia.interleaved-multimedia", + "video/vnd.nokia.mp4vr", + "video/vnd.nokia.videovoip", + "video/vnd.objectvideo", + "video/vnd.radgamettools.bink", + "video/vnd.radgamettools.smacker", + "video/vnd.sealed.mpeg1", + "video/vnd.sealed.mpeg4", + "video/vnd.sealed.swf", + "video/vnd.sealedmedia.softseal.mov", + "video/vnd.uvvu.mp4", + "video/vnd.youtube.yt", + "video/vnd.vivo", + "video/VP8", + "video/VP9", - "audio/mp4", - "audio/webm", + "audio/1d-interleaved-parityfec", + "audio/32kadpcm", + "audio/3gpp", + "audio/3gpp2", "audio/aac", + "audio/ac3", + "audio/AMR", + "audio/AMR-WB", + "audio/amr-wb+", + "audio/aptx", + "audio/asc", + "audio/ATRAC-ADVANCED-LOSSLESS", + "audio/ATRAC-X", + "audio/ATRAC3", + "audio/basic", + "audio/BV16", + "audio/BV32", + "audio/clearmode", + "audio/CN", + "audio/DAT12", + "audio/dls", + "audio/dsr-es201108", + "audio/dsr-es202050", + "audio/dsr-es202211", + "audio/dsr-es202212", + "audio/DV", + "audio/DVI4", + "audio/eac3", + "audio/encaprtp", + "audio/EVRC", + "audio/EVRC-QCP", + "audio/EVRC0", + "audio/EVRC1", + "audio/EVRCB", + "audio/EVRCB0", + "audio/EVRCB1", + "audio/EVRCNW", + "audio/EVRCNW0", + "audio/EVRCNW1", + "audio/EVRCWB", + "audio/EVRCWB0", + "audio/EVRCWB1", + "audio/EVS", + "audio/example", + "audio/flexfec", + "audio/fwdred", + "audio/G711-0", + "audio/G719", + "audio/G7221", + "audio/G722", + "audio/G723", + "audio/G726-16", + "audio/G726-24", + "audio/G726-32", + "audio/G726-40", + "audio/G728", + "audio/G729", + "audio/G7291", + "audio/G729D", + "audio/G729E", + "audio/GSM", + "audio/GSM-EFR", + "audio/GSM-HR-08", + "audio/iLBC", + "audio/ip-mr_v2.5", + "audio/L8", + "audio/L16", + "audio/L20", + "audio/L24", + "audio/LPC", + "audio/MELP", + "audio/MELP600", + "audio/MELP1200", + "audio/MELP2400", + "audio/mhas", + "audio/mobile-xmf", + "audio/MPA", + "audio/mp4", + "audio/MP4A-LATM", + "audio/mpa-robust", "audio/mpeg", + "audio/mpeg4-generic", "audio/ogg", - "audio/wave", - "audio/wav", - "audio/x-wav", - "audio/x-pn-wav", - "audio/flac", - "audio/x-flac", + "audio/opus", + "audio/parityfec", + "audio/PCMA", + "audio/PCMA-WB", + "audio/PCMU", + "audio/PCMU-WB", + "audio/prs.sid", + "audio/QCELP", + "audio/raptorfec", + "audio/RED", + "audio/rtp-enc-aescm128", + "audio/rtploopback", + "audio/rtp-midi", + "audio/rtx", + "audio/scip", + "audio/SMV", + "audio/SMV0", + "audio/SMV-QCP", + "audio/sofa", + "audio/sp-midi", + "audio/speex", + "audio/t140c", + "audio/t38", + "audio/telephone-event", + "audio/TETRA_ACELP", + "audio/TETRA_ACELP_BB", + "audio/tone", + "audio/TSVCIS", + "audio/UEMCLIP", + "audio/ulpfec", + "audio/usac", + "audio/VDVI", + "audio/VMR-WB", + "audio/vnd.3gpp.iufp", + "audio/vnd.4SB", + "audio/vnd.audiokoz", + "audio/vnd.CELP", + "audio/vnd.cisco.nse", + "audio/vnd.cmles.radio-events", + "audio/vnd.cns.anp1", + "audio/vnd.cns.inf1", + "audio/vnd.dece.audio", + "audio/vnd.digital-winds", + "audio/vnd.dlna.adts", + "audio/vnd.dolby.heaac.1", + "audio/vnd.dolby.heaac.2", + "audio/vnd.dolby.mlp", + "audio/vnd.dolby.mps", + "audio/vnd.dolby.pl2", + "audio/vnd.dolby.pl2x", + "audio/vnd.dolby.pl2z", + "audio/vnd.dolby.pulse.1", + "audio/vnd.dra", + "audio/vnd.dts", + "audio/vnd.dts.hd", + "audio/vnd.dts.uhd", + "audio/vnd.dvb.file", + "audio/vnd.everad.plj", + "audio/vnd.hns.audio", + "audio/vnd.lucent.voice", + "audio/vnd.ms-playready.media.pya", + "audio/vnd.nokia.mobile-xmf", + "audio/vnd.nortel.vbk", + "audio/vnd.nuera.ecelp4800", + "audio/vnd.nuera.ecelp7470", + "audio/vnd.nuera.ecelp9600", + "audio/vnd.octel.sbc", + "audio/vnd.presonus.multitrack", + "audio/vnd.qcelp", + "audio/vnd.rhetorex.32kadpcm", + "audio/vnd.rip", + "audio/vnd.sealedmedia.softseal.mpeg", + "audio/vnd.vmx.cvsd", + "audio/vorbis", + "audio/vorbis-config", ]; export function getBlobSafeMimeType(mimetype: string) {