From a754e007776773c0767634a7612c4b1d8fd13fd3 Mon Sep 17 00:00:00 2001 From: Ar Rakin Date: Wed, 28 Aug 2024 13:06:00 +0600 Subject: [PATCH] fix: 400 errors on subdomainds in production Signed-off-by: Ar Rakin --- src/middleware.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/middleware.ts b/src/middleware.ts index 3805c7c..f69ea27 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -12,14 +12,14 @@ const httpStatusText: Record = { 500: "Internal Server Error", }; -const FRONTEND_DOMAIN = process.env.NEXT_PUBLIC_FRONTEND_DOMAIN?.replace( +const FRONTEND_DOMAIN = process.env.NEXT_PUBLIC_FRONTEND_ROOT_DOMAIN?.replace( /:\d+$/, "", ); function error(status: number, message: string) { const [hostname, port] = - process.env.NEXT_PUBLIC_FRONTEND_DOMAIN?.split(":") ?? []; + process.env.NEXT_PUBLIC_FRONTEND_ROOT_DOMAIN?.split(":") ?? []; const html = `