mirror of
https://github.com/juherr/kill-the-news.git
synced 2026-06-20 22:03:48 +00:00
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:
+2
-2
@@ -2,7 +2,7 @@ import { Context } from "hono";
|
||||
import { Env } from "../types";
|
||||
import { generateJsonFeed } from "../infrastructure/feed-generator";
|
||||
import { fetchFeedData } from "../application/feed-fetcher";
|
||||
import { baseUrl } from "../infrastructure/urls";
|
||||
import { baseUrl, feedJsonUrl } from "../infrastructure/urls";
|
||||
import { isExpired } from "../domain/feed";
|
||||
import { FeedId } from "../domain/value-objects/feed-id";
|
||||
|
||||
@@ -22,7 +22,7 @@ export async function handle(c: Context<{ Bindings: Env }>): Promise<Response> {
|
||||
}
|
||||
|
||||
const base = baseUrl(c.env);
|
||||
const selfUrl = new URL(c.req.url).origin + `/json/${feedId}`;
|
||||
const selfUrl = feedJsonUrl(feedId, c.env);
|
||||
const jsonFeed = generateJsonFeed(
|
||||
feedData.feedConfig,
|
||||
feedData.emails,
|
||||
|
||||
Reference in New Issue
Block a user