ui: typescript language features

This commit is contained in:
undefined committed 2021-05-06 22:28:12 +08:00
1 parent a44055d54a
commit 0bd1b5fdbd
8 files changed
+196 -109

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.24.17",
"version": "2.24.18",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",
+4
View File
@@ -482,6 +482,10 @@ export class Handler extends HandlerCommon {
}
async init({ domainId }) {
if (this.request.headers.referer) {
const hostname = new URL(this.request.headers.referer).hostname;
if (hostname !== this.request.hostname) throw new CsrfTokenError();
}
if (!argv.benchmark) await this.limitRate('global', 10, 88);
const [absoluteDomain, inferDomain, bdoc] = await Promise.all([
domain.get(domainId),