Add redirect for feed readers checking /feed

v1.1.0
Max Nuding 2023-04-07 17:06:27 +02:00
parent cce926866d
commit 150d86b50c
Signed by: phlaym
GPG Key ID: A06651BAB6777237
1 changed files with 4 additions and 0 deletions

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(