mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: fix additional_files in contest&homework
This commit is contained in:
1 parent
eade2aaf56
commit
ff943b620e
3 files changed
+5
-1
No files matched your search
@@ -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',
|
||||
|
||||
Reference in new issue
Block a user