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 length = res.headers['content-length'];
if(cfg.allowedMimes.hasOwnProperty(type)) {
if(length <= cfg.maxFileSize) {
//if(length <= cfg.maxFileSize) {
if(data.length <= cfg.maxFileSize) {
var s = new Readable
s.push(data);
s.push(null);
@ -156,7 +157,7 @@ module.exports = (lib) => {
else {
dat.close();
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 {