seo: always serve sitemap.xml even if DB unavailable

Co-authored-by: dennis <dennis@konkol.net>
This commit is contained in:
Cursor Agent
2026-01-15 10:12:38 +00:00
parent d60f875793
commit b90a3d589c
2 changed files with 7 additions and 3 deletions

View File

@@ -12,8 +12,8 @@ export async function GET() {
});
} catch (error) {
console.error("Error generating sitemap.xml:", error);
// Always return a valid sitemap with 200 so crawlers don't treat it as broken.
return new NextResponse(generateSitemapXml([]), {
status: 500,
headers: { "Content-Type": "application/xml" },
});
}