fix(server): RSS SITE_ORIGIN + sitemap /page path - #112
Merged
one-ea merged 1 commit intoJul 23, 2026
Conversation
- RSS previously used request origin only. When /rss.xml is reverse-proxied through Pages Functions to the Worker, item/channel links become *.workers.dev instead of the public site origin. Prefer SITE_ORIGIN like sitemap.xml and robots.txt already do. - Sitemap listed independent pages as /pages/:slug, but the SPA route is /page/:slug (client/src/app.tsx, navbar, footer, admin preview). Use the singular path so crawlers get valid URLs.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (1)server/src/index.ts⚙️ CodeRabbit configuration file
Files:
🔇 Additional comments (3)
📝 WalkthroughSummary by CodeRabbit
Walkthrough更新 Changes站点 URL 生成
Estimated code review effort: 2 (Simple) | ~5 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small SEO correctness fixes in
server/src/index.ts. Verified still present onone-ea/Monolith@mainbefore opening this PR.1. RSS should prefer
SITE_ORIGINBug:
/rss.xmlbuilds channel/item links withnew URL(c.req.url).originonly.In the recommended Cloudflare setup, Pages Functions reverse-proxy
/rss.xmlto the Worker (client/functions/rss.xml.ts). The Worker then sees a*.workers.devrequest origin, so the feed emits workers.dev absolute links instead of the public site domain.Why this is real upstream:
sitemap.xmlandrobots.txtalready usec.env.SITE_ORIGIN || requestOrigin. RSS was left on request origin only. The env comment even documentsSITE_ORIGINfor sitemap/robots, but not RSS.Fix: use the same origin resolution as sitemap/robots:
2. Sitemap independent pages path is wrong
Bug: sitemap writes independent pages as
/pages/:slug.Frontend route is singular
/page/:slug:client/src/app.tsx→<Route path="/page/:slug" ...>/page/${slug}So sitemap currently advertises URLs that do not match the app router.
Fix: emit
/page/:slug.Test plan
SITE_ORIGIN=https://example.com,GET /rss.xmlchannel/item<link>and<guid>usehttps://example.com, not the Worker hostSITE_ORIGIN, RSS still falls back to request origin (previous behavior)GET /sitemap.xmlindependent page entries use/page/<slug>(not/pages/<slug>)robots.txtbehavior unchangedNotes
SITE_ORIGINis unset