Repository navigation
Keep control-plane responses out of search indexes - #244
Merged
Merged
Conversation
Search engines listed the control-plane sign-in page. Send X-Robots-Tag: noindex on every response the Node and Worker hooks resolve, so pages, API responses and error pages are not indexed.
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.
Search engines index the control plane: Google lists its root and sign-in page in search results. The control plane is a signed-in management UI and has no content that belongs in search results.
Change
Both server hooks (Node and Cloudflare Worker) set
X-Robots-Tag: noindexbefore resolving a request. SvelteKit applies the header to every resolved response: pages, API responses, remote functions, health checks and 404 pages.There is deliberately no
Disallowinrobots.txt. A crawler that cannot fetch a page never sees itsnoindex, and URLs that are already indexed can stay listed.The control-plane Worker only serves the platform hostname. App hostnames are served by the runtime Worker, so app pages are not affected.
Redirects thrown from the session hook before
resolve(for example/→/sign-in) do not carry the header. Search engines do not index redirect responses; they follow the redirect and seenoindexon the target.Tests
/sign-in,/recover,/healthz,/api/v1/appsand a 404 returnX-Robots-Tag: noindex. The test fails without the change.RUN_CLOUDFLARE_TESTS=1):/sign-in,/healthzand/api/v1/appsreturn the header from workerd.pnpm check, the fullauth.spec.ts(51 tests) andtests/cloudflare/control-plane.test.ts(16 tests) pass locally.

Confidence Score: 5/5
This PR appears safe to merge.Summary
Adds
X-Robots-Tag: noindexto resolved control-plane responses on Node and Cloudflare.No actionable issues found. Tests were not run during this review.
Reviews (1) · Last reviewed commit: "Keep control-plane responses out of sear..." · Reviewed by Greptile