core: fix additional_files in contest&homework

pull/187/head
undefined 3 years ago
parent eade2aaf56
commit ff943b620e

@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.32.15",
"version": "2.32.16",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",

@ -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',

@ -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',

Loading…
Cancel
Save