From 150d86b50c9c2be0e27228b377019304fcbdde6b Mon Sep 17 00:00:00 2001 From: Max Nuding Date: Fri, 7 Apr 2023 17:06:27 +0200 Subject: [PATCH] Add redirect for feed readers checking /feed --- src/hooks.server.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hooks.server.ts b/src/hooks.server.ts index 1397453..18198d9 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -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(