moar mimetypes!
This commit is contained in:
parent
dda1c587e9
commit
e0ff84187b
|
@ -185,10 +185,12 @@ module.exports = (lib) => {
|
||||||
lib.checkRepostCheckSum(cbcs, (cbcrcs) => {
|
lib.checkRepostCheckSum(cbcs, (cbcrcs) => {
|
||||||
if(cbcrcs === true) {
|
if(cbcrcs === true) {
|
||||||
var mime = fileType(readChunk.sync('./b/' + tmpdest, 0, 262));
|
var mime = fileType(readChunk.sync('./b/' + tmpdest, 0, 262));
|
||||||
|
info.ext = mime.ext;
|
||||||
|
info.mime = mime.mime;
|
||||||
if(lib.cfg.main.allowedMimes.hasOwnProperty(mime.mime) || info.type === 'soundcloud')
|
if(lib.cfg.main.allowedMimes.hasOwnProperty(mime.mime) || info.type === 'soundcloud')
|
||||||
cb({ success: true, info: info, size: size, file: './b/' + tmpdest, checksum: cbcs });
|
cb({ success: true, info: info, size: size, file: './b/' + tmpdest, checksum: cbcs });
|
||||||
else
|
else
|
||||||
cb({ success: false, file: tmpdest, msg: 'lol, go f0ck yourself ('+JSON.stringify(mime)+')' });
|
cb({ success: false, file: tmpdest, msg: 'lol, go f0ck yourself ('+mime.mime+')' });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
cb({ success: false, file: tmpdest, msg: 'repost motherf0cker: '+lib.cfg.main.url+'/'+cbcrcs });
|
cb({ success: false, file: tmpdest, msg: 'repost motherf0cker: '+lib.cfg.main.url+'/'+cbcrcs });
|
||||||
|
|
Loading…
Reference in New Issue
Block a user