Add redirect for feed readers checking /feed

This commit is contained in:
Max Nuding 2023-04-07 17:06:27 +02:00
parent cce926866d
commit 150d86b50c
Signed by: phlaym
GPG Key ID: A06651BAB6777237

View File

@ -18,6 +18,10 @@ export const handleError = (({ error }) => {
import type { Handle } from '@sveltejs/kit';
export const handle = (async ({ event, resolve }) => {
// Reeder *insists* on checking /feed instead of /feed.xml
if (event.url.pathname === '/feed') {
return new Response('', { status: 301, headers: { Location: '/feed.xml' } });
}
if (event.url.pathname === '/feed.xml') {
const f = await fs.readFile('feed.xml', { encoding: 'utf8' });
return new Response(