mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: fix filter
This commit is contained in:
1 parent
fc98c61f7b
commit
229869bc5c
2 files changed
+4
-4
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.24.19",
|
"version": "2.24.20",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "dist/loader.js",
|
"main": "dist/loader.js",
|
||||||
"typings": "dist/loader.d.ts",
|
"typings": "dist/loader.d.ts",
|
||||||
|
|||||||
@@ -520,9 +520,9 @@ export class Handler extends HandlerCommon {
|
|||||||
text: global.Hydro.lib[key].text,
|
text: global.Hydro.lib[key].text,
|
||||||
}));
|
}));
|
||||||
if (!this.noCheckPermView) this.checkPerm(PERM.PERM_VIEW);
|
if (!this.noCheckPermView) this.checkPerm(PERM.PERM_VIEW);
|
||||||
if (this.request.method === 'POST' && this.request.headers.referer) {
|
if (this.request.method === 'post' && this.request.headers.referer !== '/') {
|
||||||
const hostname = new URL(this.request.headers.referer).hostname;
|
const host = new URL(this.request.headers.referer).host;
|
||||||
if (hostname !== this.request.hostname) throw new CsrfTokenError(hostname);
|
if (host !== this.request.host) throw new CsrfTokenError(host);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user