core: handle image download cache

This commit is contained in:
undefined committed 2021-08-17 22:21:27 +08:00
1 parent 33b9b0b048
commit d0471b0de8
17 files changed
+132 -93

No files matched your search

+1 -1
View File
@@ -122,7 +122,7 @@ class ImportQduojHandler extends Handler {
async post({ domainId }) {
if (!this.request.files.file) throw new ValidationError('file');
const stat = await fs.stat(this.request.files.file.path);
if (stat.size > 128 * 1024 * 1024) throw new BadRequestError('File too large');
if (stat.size > 128 * 1024 * 1024) throw new ValidationError('file', 'File too large');
await this.ImportFromFile(domainId, this.request.files.file.path);
this.response.redirect = this.url('problem_main');
}