enforce maxUploadSize

This commit is contained in:
ansuz
2018-01-18 12:19:58 +01:00
parent fc8847dae4
commit 02dbe9e458
3 changed files with 5 additions and 2 deletions

1
rpc.js
View File

@@ -935,6 +935,7 @@ var upload_status = function (Env, publicKey, filesize, cb) {
if (typeof(filesize) !== 'number' &&
filesize >= 0) { return void cb('E_INVALID_SIZE'); }
if (filesize >= Env.maxUploadSize) { return cb('TOO_LARGE'); }
// validate that the provided path is not junk
var filePath = makeFilePath(paths.staging, publicKey);
if (!filePath) { return void cb('E_INVALID_PATH'); }