fix(components): return 404 for unknown component libraries - #752
Draft
dgaponov wants to merge 1 commit into
Draft
fix(components): return 404 for unknown component libraries#752dgaponov wants to merge 1 commit into
dgaponov wants to merge 1 commit into
Conversation
/components/<anything> rendered an empty shell with HTTP 200, so an unlimited number of non-existent URLs were indexable soft 404s. Other bad paths behaved correctly: /<nonsense> and /components/uikit/<nonsense> already returned 404. Guard getServerSideProps with a lookup against `libs`, mirroring the existing check in src/pages/design/[sectionId]/index.tsx, where this pattern was already applied. Scope is limited to the soft-404 surface. /components and /components/uikit still render a client-redirect stub; giving them real content is tracked separately, so they are deliberately not turned into redirects here. Verified in dev and in a production build: unknown libs return the real 404 page in en/ru/es, valid library, component, design and landing pages still return 200, and a scan of all 160 sitemap URLs shows no new failures. Build, lint and typecheck pass. E2E not run — Playwright browsers are not installed locally. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
/components/<что угодно>отдавал 200 с пустой оболочкой — неограниченное число несуществующих URL было индексируемыми soft 404. При этом/<чушь>и/components/uikit/<чушь>уже корректно отдавали 404.Добавлена проверка
libIdпоlibsвgetServerSideProps— ровно та же, что уже есть вsrc/pages/design/[sectionId]/index.tsx./componentsи/components/uikitнамеренно оставлены как есть: эти URL должны ранжироваться, им нужен контент, а не редирект.Проверено: 404 в en/ru/es, остальные страницы 200, скан всех URL sitemap без новых падений.
🤖 Generated with Claude Code