Add redirect for feed readers checking /feed
This commit is contained in:
parent
cce926866d
commit
150d86b50c
@ -18,6 +18,10 @@ export const handleError = (({ error }) => {
|
|||||||
import type { Handle } from '@sveltejs/kit';
|
import type { Handle } from '@sveltejs/kit';
|
||||||
|
|
||||||
export const handle = (async ({ event, resolve }) => {
|
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') {
|
if (event.url.pathname === '/feed.xml') {
|
||||||
const f = await fs.readFile('feed.xml', { encoding: 'utf8' });
|
const f = await fs.readFile('feed.xml', { encoding: 'utf8' });
|
||||||
return new Response(
|
return new Response(
|
||||||
|
Loading…
Reference in New Issue
Block a user