Skip to content

Commit

Permalink
fix: 400 errors on subdomainds in production
Browse files Browse the repository at this point in the history
Signed-off-by: Ar Rakin <rakinar2@gmail.com>
  • Loading branch information
virtual-designer authored Aug 28, 2024
1 parent c1636f1 commit a754e00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ const httpStatusText: Record<number, string> = {
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 = `
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
Expand Down

0 comments on commit a754e00

Please sign in to comment.