Skip to content

fix(realtime): noindex the socket server's 404 responses - #6129

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/seo-unused-subdomains
Jul 31, 2026
Merged

fix(realtime): noindex the socket server's 404 responses#6129
waleedlatif1 merged 2 commits into
stagingfrom
fix/seo-unused-subdomains

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • The sockets.* hostnames are served by apps/realtime and return a plain JSON 404. Google Search Console reports these as crawl errors and keeps retrying them.
  • Set X-Robots-Tag: noindex, nofollow on unmatched routes so crawlers drop the hostnames.
  • Covers all four socket hosts across every environment in one place, instead of duplicating a CloudFront response-headers policy across three distributions.

Part of a wider SEO cleanup from a list of unused subdomains. The remaining items are infra-side (a Vercel wildcard DNS record, and an ALB redirect leaking :443) and are not in this repo.

Type of Change

  • Bug fix

Testing

Added http.test.ts covering the handler. Verified the noindex test fails when the change is reverted, with the health-check assertion as a control that stays green. Full realtime suite passes (136 tests), lint and typecheck clean.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 31, 2026 7:46pm

Request Review

@cursor

cursor Bot commented Jul 31, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
SEO header on 404-only paths in the realtime HTTP handler; no auth, data, or API behavior changes.

Overview
Socket hostnames (sockets.*) were returning plain JSON 404s that crawlers kept retrying in Search Console. Unmatched routes in createHttpHandler now send X-Robots-Tag: noindex, nofollow on those 404 responses so bots drop the URLs. /health and other known routes are unchanged.

Adds http.test.ts to assert the noindex header on unknown paths and that the health check does not include it.

Reviewed by Cursor Bugbot for commit a256f7c. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds an X-Robots-Tag: noindex, nofollow header to realtime HTTP responses and introduces tests covering health, internal API, and unmatched-route behavior.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/realtime/src/routes/http.ts Adds the crawler directive at the shared HTTP handler entry point so it applies consistently to every handled response.
apps/realtime/src/routes/http.test.ts Adds focused handler tests for the crawler header and verifies existing health-check and unmatched-route status behavior remains unchanged.

Reviews (2): Last reviewed commit: "fix(realtime): noindex every response, n..." | Re-trigger Greptile

The sockets.* hostnames are served by this server and return a plain JSON
404, which Google Search Console reports as crawl errors. Mark unmatched
routes noindex so crawlers drop the hostnames instead of retrying them.
Setting the header only on the 404 fallback covered the one response that
crawlers already drop on status code alone, while /health — the sole route
returning 200 with a body, and so the only indexable surface on the socket
hostnames — stayed uncovered, with a test pinning it that way.

Set it once on the handler instead. Node merges setHeader values into
writeHead and no branch sets X-Robots-Tag, so it reaches every response.
@waleedlatif1
waleedlatif1 force-pushed the fix/seo-unused-subdomains branch from a256f7c to 88e8747 Compare July 31, 2026 19:45
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

1 similar comment
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@waleedlatif1
waleedlatif1 merged commit e98715d into staging Jul 31, 2026
26 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/seo-unused-subdomains branch July 31, 2026 19:55
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.

1 participant