Skip to content

Commit

Permalink
fix: type errors
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 3f8cd2f commit 9475a29
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ 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_DOMAIN!.replace(
/:\d+$/,
"",
);

const FRONTEND_ROOT_DOMAIN = process.env.NEXT_PUBLIC_FRONTEND_ROOT_DOMAIN?.replace(
const FRONTEND_ROOT_DOMAIN = process.env.NEXT_PUBLIC_FRONTEND_ROOT_DOMAIN!.replace(
/:\d+$/,
"",
);
Expand Down Expand Up @@ -94,7 +94,7 @@ export function middleware(request: NextRequest) {
}

if (hostname === FRONTEND_DOMAIN || hostname === FRONTEND_ROOT_DOMAIN) {
requestHeaders.set("x-domain", FRONTEND_ROOT_DOMAIN);
requestHeaders.set("x-domain", FRONTEND_ROOT_DOMAIN ?? "");

return NextResponse.next({
request: {
Expand Down

0 comments on commit 9475a29

Please sign in to comment.