From f9918128a96a7447458da06bb6d247ec57a1b022 Mon Sep 17 00:00:00 2001 From: undefined Date: Wed, 23 Mar 2022 23:36:26 +0800 Subject: [PATCH] core: fix problem_copy testdata link --- packages/hydrooj/package.json | 2 +- packages/hydrooj/src/handler/problem.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/hydrooj/package.json b/packages/hydrooj/package.json index 2b9c354d..46ab89ea 100644 --- a/packages/hydrooj/package.json +++ b/packages/hydrooj/package.json @@ -1,6 +1,6 @@ { "name": "hydrooj", - "version": "3.10.4", + "version": "3.10.5", "bin": "bin/hydrooj.js", "main": "src/loader", "module": "src/loader", diff --git a/packages/hydrooj/src/handler/problem.ts b/packages/hydrooj/src/handler/problem.ts index 704288c6..90a85c7a 100644 --- a/packages/hydrooj/src/handler/problem.ts +++ b/packages/hydrooj/src/handler/problem.ts @@ -558,6 +558,7 @@ export class ProblemFilesHandler extends ProblemDetailHandler { @post('type', Types.Range(['testdata', 'additional_file']), true) async postGetLinks(domainId: string, files: Set, type = 'testdata') { if (type === 'testdata' && !this.user.own(this.pdoc)) { + if (this.pdoc.reference) throw new BadRequestError('Cannot download testdata.'); if (!this.user.hasPriv(PRIV.PRIV_READ_PROBLEM_DATA)) this.checkPerm(PERM.PERM_READ_PROBLEM_DATA); if (this.tdoc && !contest.isDone(this.tdoc)) throw new ContestNotEndedError(this.tdoc.domainId, this.tdoc.docId); }