mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: domain existance check
This commit is contained in:
1 file changed
+1
-1
@@ -23,6 +23,6 @@ export default async (ctx: KoaContext, next) => {
|
||||
}
|
||||
ctx.domainId = inferDomain?._id || domainId;
|
||||
ctx.domainInfo = inferDomain || absoluteDomain;
|
||||
if (ctx.domainId !== ctx.domainInfo._id) ctx.redirect(ctx.originalPath.replace(/^\/d\/[^/]+\//, `/d/${ctx.domainInfo._id}/`));
|
||||
if (ctx.domainInfo && ctx.domainId !== ctx.domainInfo._id) ctx.redirect(ctx.originalPath.replace(/^\/d\/[^/]+\//, `/d/${ctx.domainInfo._id}/`));
|
||||
else await next();
|
||||
};
|
||||
Reference in new issue
Block a user