Skip to content

fix: rename /latest/feed.xml route to /latest/feed to break redirect loop - #18308

Merged
wackerow merged 2 commits into
ethereum:devfrom
tenderdeve:fix/18299-feed-redirect-loop
Jul 17, 2026
Merged

wackerow merged 2 commits into
ethereum:devfrom
tenderdeve:fix/18299-feed-redirect-loop

Conversation

@tenderdeve

Copy link
Copy Markdown
Contributor

Summary

Fixes #18299 — /latest/feed.xml returned an infinite redirect loop on production.

Root cause: Next.js trailing-slash setting + Netlify edge handling of the .xml extension caused /latest/feed.xml ↔ /latest/feed.xml/ to ping-pong. The previous .replace(/\/$/, "") hacks on feedUrl and the proxy matcher were workarounds, not a fix.

Approach: Drop the file extension from the route segment so Next.js trailing-slash handling applies cleanly.

Changes (4 files, +4/-15)

  • Renamed app/[locale]/latest/feed.xml/ → app/[locale]/latest/feed/
  • Removed .replace(/\/$/, "") hack from app/[locale]/latest/feed/route.ts
  • Removed same hack from alternates.types["application/rss+xml"] in app/[locale]/latest/page.tsx
  • Removed dead /:locale?/latest/feed.xml matcher from proxy.ts
  • Added 308 redirect /latest/feed.xml → /latest/feed/ in redirects.config.js for back-compat with existing subscribers

Test plan

  • curl -IL https://ethereum.org/latest/feed.xml — expect single 308 then 200 (no loop)
  • curl -I https://ethereum.org/latest/feed/ — expect 200 with application/rss+xml
  • Validate RSS at https://validator.w3.org/feed/
  • Existing subscribers using /latest/feed.xml still resolve via redirect

…loop

Netlify's @netlify/plugin-nextjs adds a trailing slash to extension-bearing
paths, while Next.js framework-level trailing-slash logic strips it back off
after the next-intl middleware rewrites the path with a default locale. The
two redirects ping-pong forever (ERR_TOO_MANY_REDIRECTS) on /latest/feed.xml
and every locale/trailing-slash variant.

Rename the route directory so the URL no longer has a file extension, which
makes Netlify and Next.js agree on the canonical /latest/feed/ form. Drop
the manual trailing-slash stripping on feedUrl and the alternates metadata
since getFullUrl now produces the right shape directly, and remove the
proxy.ts opt-in matcher that only existed to coax middleware into running
for the extension path. Adds a permanent /latest/feed.xml -> /latest/feed/
redirect for any external links to the old URL.

Fixes ethereum#18299
@netlify

netlify Bot commented May 29, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 338efdb
🔍 Latest deploy log https://app.netlify.com/projects/ethereumorg/deploys/6a193210f8ae93000824dc71
😎 Deploy Preview https://deploy-preview-18308.ethereum.it
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 68 (🟢 up 3 from production)
Accessibility: 96 (no change from production)
Best Practices: 100 (no change from production)
SEO: 98 (🔴 down 1 from production)
PWA: 59 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown
Contributor

This issue is stale because it has been open 30 days with no activity.

@github-actions github-actions Bot added the Status: Stale This issue is stale because it has been open 30 days with no activity. label Jun 28, 2026
@nloureiro

Copy link
Copy Markdown
Contributor

Thanks for this fix — we've confirmed the redirect loop is still live on production today (/latest/feed.xml 308-loops until the browser gives up), so this is a priority. It currently has merge conflicts with dev — could you rebase? We'll get it reviewed promptly after that.

@github-actions github-actions Bot removed the Status: Stale This issue is stale because it has been open 30 days with no activity. label Jul 7, 2026
@github-actions

github-actions Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

🔎 First-pass review — 🔧 Needs work

This fixes the /latest/feed.xml 308 redirect-loop (confirmed live on production) by renaming the route to /latest/feed, updating the RSS alternates metadata and channel self-link to the trailing-slash /latest/feed/, simplifying the proxy.ts matcher back to a single pattern, and adding a /latest/feed.xml → /latest/feed/ entry to redirects.config.js. The approach looks correct and consistent, and this is a priority bug. The blocker is mechanical: @nloureiro flagged merge conflicts with dev on Jul 6 that still need clearing.

Blocking:

  • Rebase onto dev to resolve the conflicts, then it's ready for a prompt review
Analysis

Lane: code (app/[locale]/latest/feed/route.ts renamed, latest/page.tsx, proxy.ts, redirects.config.js).

Checked: the feed URL now built as /latest/feed/ matches the new route and the redirect target; the removed proxy.ts feed-specific matcher is no longer needed once the .xml extension is gone. Couldn't re-read PR metadata from here to confirm the current mergeable state, so I'm relying on the Jul 6 conflict note.

Routing: needs dev approval 🧑💻.

Generated by PR Backlog Sweeper · 243.1 AIC · ⌖ 30.9 AIC · ⊞ 6K · ◷

@netlify

netlify Bot commented Jul 17, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 0febebb
🔍 Latest deploy log https://app.netlify.com/projects/ethereumorg/deploys/6a5a9045007f36000851162e
😎 Deploy Preview https://deploy-preview-18308.ethereum.it
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 57 (🔴 down 1 from production)
Accessibility: 95 (no change from production)
Best Practices: 100 (no change from production)
SEO: 98 (no change from production)
PWA: 59 (🔴 down 1 from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@wackerow wackerow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wackerow
wackerow merged commit bf61790 into ethereum:dev Jul 17, 2026
17 checks passed
@claude claude Bot mentioned this pull request Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/latest/feed.xml returns infinite redirect loop

4 participants