test
This commit is contained in:
parent
4920ce213c
commit
8b62120542
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user