This commit is contained in:
Flummi 2016-09-17 10:15:51 +00:00
parent 4920ce213c
commit 8b62120542

View File

@ -140,7 +140,8 @@ module.exports = (lib) => {
var type = res.headers['content-type']; var type = res.headers['content-type'];
var length = res.headers['content-length']; var length = res.headers['content-length'];
if(cfg.allowedMimes.hasOwnProperty(type)) { if(cfg.allowedMimes.hasOwnProperty(type)) {
if(length <= cfg.maxFileSize) { //if(length <= cfg.maxFileSize) {
if(data.length <= cfg.maxFileSize) {
var s = new Readable var s = new Readable
s.push(data); s.push(data);
s.push(null); s.push(null);
@ -156,7 +157,7 @@ module.exports = (lib) => {
else { else {
dat.close(); dat.close();
fs.unlinkSync('./b/' + tmpdest); fs.unlinkSync('./b/' + tmpdest);
cb({ success: false, msg: 'f0ck! your file is too big (~'+lib.formatSize(length)+'), max '+lib.formatSize(cfg.maxFileSize)+' allowed' }); cb({ success: false, msg: 'f0ck! your file is too big (~'+lib.formatSize(data.length)+'), max '+lib.formatSize(cfg.maxFileSize)+' allowed' });
} }
} }
else { else {