mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: only extract zip for testdata
This commit is contained in:
1 parent
810b4cd25e
commit
c872d02758
2 files changed
+2
-2
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "3.15.15",
|
||||
"version": "3.15.16",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -652,7 +652,7 @@ export class ProblemFilesHandler extends ProblemDetailHandler {
|
||||
if (filename.includes('/') || filename.includes('..')) throw new ValidationError('filename', null, 'Bad filename');
|
||||
if (!this.user.own(this.pdoc, PERM.PERM_EDIT_PROBLEM_SELF)) this.checkPerm(PERM.PERM_EDIT_PROBLEM);
|
||||
const files = [];
|
||||
if (filename.endsWith('.zip')) {
|
||||
if (filename.endsWith('.zip') && type === 'testdata') {
|
||||
const zip = new AdmZip(this.request.files.file.filepath);
|
||||
const entries = zip.getEntries();
|
||||
for (const entry of entries) {
|
||||
|
||||
Reference in new issue
Block a user