fix(feeds): self link uses configured domain, not request host

The RSS/Atom/JSON self link was derived from the request origin, leaking
the workers.dev host when reached directly instead of via the custom
domain. Use the configured-domain URL builders so self matches alternate.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Julien Herr
2026-05-25 18:38:38 +02:00
parent cbf6bb7e7e
commit 1332362005
6 changed files with 14 additions and 8 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ export async function handle(c: Context<{ Bindings: Env }>): Promise<Response> {
}
const base = baseUrl(c.env);
const selfUrl = new URL(c.req.url).origin + `/rss/${feedId}`;
const selfUrl = feedRssUrl(feedId, c.env);
const rssXml = generateRssFeed(
feedData.feedConfig,
feedData.emails,