seo: always serve sitemap.xml even if DB unavailable
Co-authored-by: dennis <dennis@konkol.net>
This commit is contained in:
@@ -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" },
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user