Skip to content

fix(diffshub): return real 404s for non-viewable paths - #1084

Merged
mdo merged 1 commit into
mainfrom
seo-diffshub-404s
Aug 25, 2026
Merged

fix(diffshub): return real 404s for non-viewable paths#1084
mdo merged 1 commit into
mainfrom
seo-diffshub-404s

Conversation

@mdo

@mdo mdo commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The DiffsHub catch-all viewer answered HTTP 200 for every URL ever requested, including single-segment paths that can never be a valid owner/repo diff target. This also shadowed /robots.txt and /sitemap.xml with HTML (Lighthouse flagged an invalid robots.txt).
  • resolveDiffshubViewerRoute now returns a not-found result for paths shorter than owner/repo, and the route page calls notFound().
  • Viewer pages gain per-target titles/descriptions (describeDiffTarget, e.g. owner/repo #123), a normalized canonical, and noindex, nofollow so shared links unfurl usefully without entering the index.
  • Adds SITE_ORIGIN to lib/site so metadata routes and canonicals share one origin definition.

Test plan

  • /definitely-not-a-real-path returns 404 (was 200)
  • /robots.txt and /sitemap.xml are no longer shadowed by the catch-all
  • A real PR/commit/compare/repo path still renders and now has a distinct <title>
  • moonx diffshub:typecheck and moonx diffshub:test

First of 4 stacked SEO PRs.

@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pierre-diffshub Ready Ready Preview Aug 25, 2026 4:59am
pierre-docs-trees Ready Ready Preview Aug 25, 2026 4:59am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
pierre-docs-diffs Skipped Skipped Aug 25, 2026 4:59am
pierrejs-diff-demo Skipped Skipped Aug 25, 2026 4:59am

Request Review

…etadata

The catch-all viewer answered HTTP 200 for every URL, including single-segment paths that can never be a valid owner/repo diff target, which also shadowed /robots.txt and /sitemap.xml with HTML. resolveDiffshubViewerRoute now returns a 'not-found' result for paths shorter than owner/repo and the route calls notFound(). Viewer pages also get per-target titles/descriptions (via describeDiffTarget), a normalized canonical, and noindex so shared links unfurl usefully without entering the index.
@mdo
mdo force-pushed the seo-diffshub-404s branch from 1b0cee6 to af73f5b Compare August 25, 2026 04:58
@vercel
vercel Bot temporarily deployed to Preview – pierre-docs-diffs August 25, 2026 04:58 Inactive
@vercel
vercel Bot temporarily deployed to Preview – pierrejs-diff-demo August 25, 2026 04:58 Inactive
@mdo
mdo merged commit 216e604 into main Aug 25, 2026
8 checks passed
@mdo
mdo deleted the seo-diffshub-404s branch August 25, 2026 15:44
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.

2 participants