jschan - Anonymous imageboard software. Classic look, modern features and feel. Works without JavaScript and supports Tor, I2P, Lokinet, etc.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

46 lines
835 B

'use strict';
const image = new Set([
'image/jpeg',
'image/pjpeg',
'image/png',
'image/bmp',
]);
const animatedImage = new Set([
'image/gif',
'image/webp',
'image/apng',
]);
const video = new Set([
'video/mpeg',
'video/quicktime',
'video/mp4',
'video/webm',
'video/x-matroska',
]);
const audio = new Set([
'audio/mp3',
'audio/mpeg',
'audio/ogg',
'audio/wave',
'audio/wav',
]);
const other = new Set(require(__dirname+'/../../configs/main.js').otherMimeTypes);
module.exports = {
allowed: (mimetype, options) => {
return (options.image && image.has(mimetype)) ||
(options.animatedImage && animatedImage.has(mimetype)) ||
(options.video && video.has(mimetype)) ||
(options.audio && audio.has(mimetype)) ||
(options.other && other.has(mimetype));
},
image, animatedImage, video, audio, other
};