Skip to content

Commit

Permalink
Present html also
Browse files Browse the repository at this point in the history
  • Loading branch information
fraxachun committed Feb 12, 2025
1 parent a295913 commit 1a7409e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion site/src/middleware/redirectToMainHost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ export function withRedirectToMainHostMiddleware(middleware: CustomMiddleware) {
return NextResponse.redirect(redirectSiteConfig.url);
}

return new NextResponse(null, { status: 404 });
const response = new NextResponse(
'<!DOCTYPE html><html lang="en"><head><meta charset=utf-8><title>404</title></head><body>Cannot resolve domain</body></html>',
{
status: 404,
},
);
response.headers.set("Content-Type", "text/html; charset=utf-8");
return response;
}
return middleware(request);
};
Expand Down

0 comments on commit 1a7409e

Please sign in to comment.