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:
@@ -117,10 +117,12 @@ describe("Atom Feed Route", () => {
|
||||
expect(body).toContain("Atom Test Feed");
|
||||
});
|
||||
|
||||
it("self-link points to atom URL", async () => {
|
||||
it("self-link uses the configured domain, not the request host", async () => {
|
||||
const res = await testApp.request(`/${FEED_ID}`, {}, mockEnv);
|
||||
const body = await res.text();
|
||||
expect(body).toContain(`/atom/${FEED_ID}`);
|
||||
expect(body).toContain(
|
||||
`rel="self" href="https://${mockEnv.DOMAIN}/atom/${FEED_ID}"`,
|
||||
);
|
||||
});
|
||||
|
||||
it("Link header advertises hub and self for WebSub discovery", async () => {
|
||||
|
||||
Reference in New Issue
Block a user