Skip to content

Commit 1a7409e

Browse files
committed
Present html also
1 parent a295913 commit 1a7409e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

site/src/middleware/redirectToMainHost.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@ export function withRedirectToMainHostMiddleware(middleware: CustomMiddleware) {
2323
return NextResponse.redirect(redirectSiteConfig.url);
2424
}
2525

26-
return new NextResponse(null, { status: 404 });
26+
const response = new NextResponse(
27+
'<!DOCTYPE html><html lang="en"><head><meta charset=utf-8><title>404</title></head><body>Cannot resolve domain</body></html>',
28+
{
29+
status: 404,
30+
},
31+
);
32+
response.headers.set("Content-Type", "text/html; charset=utf-8");
33+
return response;
2734
}
2835
return middleware(request);
2936
};

0 commit comments

Comments
 (0)