core: fix additional_files in contest&homework

This commit is contained in:
undefined committed 2021-08-11 21:11:04 +08:00
1 parent eade2aaf56
commit ff943b620e
3 files changed
+5 -1

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.32.15",
"version": "2.32.16",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",
+2
View File
@@ -317,6 +317,8 @@ export class ContestProblemFileDownloadHandler extends ContestProblemHandler {
if (type === 'testdata' && !this.user.own(this.pdoc)) {
if (!this.user.hasPriv(PRIV.PRIV_READ_PROBLEM_DATA)) this.checkPerm(PERM.PERM_READ_PROBLEM_DATA);
}
// @ts-ignore
if (typeof this.pdoc.docId === 'string') this.pdoc.docId = this.pdoc.docId.split(':')[1];
this.response.redirect = await storage.signDownloadLink(
`problem/${this.pdoc.domainId}/${this.pdoc.docId}/${type}/${filename}`,
noDisposition ? undefined : filename, false, 'user',
+2
View File
@@ -183,6 +183,8 @@ export class HomeworkProblemFileDownloadHandler extends HomeworkDetailProblemHan
if (type === 'testdata' && !this.user.own(this.pdoc)) {
if (!this.user.hasPriv(PRIV.PRIV_READ_PROBLEM_DATA)) this.checkPerm(PERM.PERM_READ_PROBLEM_DATA);
}
// @ts-ignore
if (typeof this.pdoc.docId === 'string') this.pdoc.docId = this.pdoc.docId.split(':')[1];
this.response.redirect = await storage.signDownloadLink(
`problem/${this.pdoc.domainId}/${this.pdoc.docId}/${type}/${filename}`,
noDisposition ? undefined : filename, false, 'user',