From ca71f7b9241603a30b811779c502e4710c45e9d9 Mon Sep 17 00:00:00 2001 From: Yufan Sheng Date: Thu, 20 Jun 2024 23:05:12 +0800 Subject: [PATCH] chore: add HEAD endpoint for /feed --- src/pages/feed.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/pages/feed.ts b/src/pages/feed.ts index 9012210..f13f43a 100644 --- a/src/pages/feed.ts +++ b/src/pages/feed.ts @@ -116,3 +116,15 @@ export const GET = async () => { })), }); }; + +// The rss reader may prefetch by using HEAD method. +export const HEAD = async () => { + return new Response('', { + headers: { + Host: import.meta.env.SITE, + 'Content-Type': 'application/xml', + Accept: '*/*', + Connection: 'keep-alive', + }, + }); +};