feat(websub): add hub discovery Link headers to RSS and Atom feeds

This commit is contained in:
Julien Herr
2026-05-21 23:06:18 +02:00
parent aa41337c6b
commit 6d221a07dd
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -65,11 +65,17 @@ export async function handle(c: Context): Promise<Response> {
const rssXml = generateRssFeed(feedConfig, emailsData, baseUrl, feedId);
// Return the RSS feed with appropriate content type
const linkHeader = [
`<https://${env.DOMAIN}/hub>; rel="hub"`,
`<https://${env.DOMAIN}/rss/${feedId}>; rel="self"`,
].join(", ");
return new Response(rssXml, {
status: 200,
headers: {
"Content-Type": "application/rss+xml",
"Cache-Control": "max-age=1800", // 30 minutes cache
Link: linkHeader,
},
});
} catch (error) {