fix(diffshub): return real 404s for non-viewable paths - #1084
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
3 tasks
necolas
approved these changes
Aug 19, 2026
This was referenced Aug 19, 2026
…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.
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
owner/repodiff target. This also shadowed/robots.txtand/sitemap.xmlwith HTML (Lighthouse flagged an invalid robots.txt).resolveDiffshubViewerRoutenow returns anot-foundresult for paths shorter thanowner/repo, and the route page callsnotFound().describeDiffTarget, e.g.owner/repo #123), a normalized canonical, andnoindex, nofollowso shared links unfurl usefully without entering the index.SITE_ORIGINtolib/siteso metadata routes and canonicals share one origin definition.Test plan
/definitely-not-a-real-pathreturns 404 (was 200)/robots.txtand/sitemap.xmlare no longer shadowed by the catch-all<title>moonx diffshub:typecheckandmoonx diffshub:testFirst of 4 stacked SEO PRs.