From 311caee15426e8fb579c6fbe4dae0a3ad9388ee2 Mon Sep 17 00:00:00 2001 From: panda Date: Tue, 11 Jun 2024 11:34:42 +0800 Subject: [PATCH] core: fix websocket can not generate url (#825) --- packages/hydrooj/src/service/server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/hydrooj/src/service/server.ts b/packages/hydrooj/src/service/server.ts index 7657b8445..167ac0276 100644 --- a/packages/hydrooj/src/service/server.ts +++ b/packages/hydrooj/src/service/server.ts @@ -209,7 +209,7 @@ export async function apply(ctx: Context) { ? (!host.includes(this.request.host)) : this.request.host !== host) )) withDomainId ||= domainId; - res = this.context.router.url.call(this.context.router, name, args, { query }).toString(); + res = ctx.server.router.url.call(ctx.server.router, name, args, { query }).toString(); if (anchor) res = `${res}#${anchor}`; if (withDomainId) res = `/d/${withDomainId}${res}`; } catch (e) {