core: fix url generation with domainId

This commit is contained in:
undefined committed 2022-05-08 21:52:10 +08:00
1 parent 116415707b
commit 6c274497b4
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "3.12.2",
"version": "3.12.3",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",
@@ -52,7 +52,7 @@ export default (router, logger) => async (ctx: KoaContext, next) => {
|| (host instanceof Array
? (!host.includes(request.host))
: request.host !== host)
)) withDomainId = domainId;
)) withDomainId ||= domainId;
res = router.url(name, args, { query }).toString();
if (anchor) res = `${res}#${anchor}`;
if (withDomainId) res = `/d/${withDomainId}${res}`;