Skip to content

feat(renderJson): default ?renderJson CORS to open (any origin, no credentials) - #476

Merged
JonasJesus42 merged 1 commit into
mainfrom
feat/renderjson-cors-default-star
Aug 18, 2026
Merged

feat(renderJson): default ?renderJson CORS to open (any origin, no credentials)#476
JonasJesus42 merged 1 commit into
mainfrom
feat/renderjson-cors-default-star

Conversation

@JonasJesus42

@JonasJesus42 JonasJesus42 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

?renderJson is public page data — secrets and request-derived keys are stripped before serialization — so it should be readable cross-origin out of the box, like any public API. pageJsonCors now defaults to "*" (Access-Control-Allow-Origin: * without credentials) instead of off. false turns it off; a string[] still reflects an allow-listed Origin with credentials for personalized cases. Since "*" carries no credentials (per the CORS spec) there's no logged-in/personalized leak — the earlier off-by-default was over-cautious for public content. tanstack tsc clean.

🤖 Generated with Claude Code


Summary by cubic

Default-open CORS for ?renderJson: when pageJsonCors is unset, we now send Access-Control-Allow-Origin: * (no credentials), since the payload is public (secrets and request-derived keys are stripped). Previously the default sent no CORS headers; false now explicitly disables CORS; a string[] still allow-lists origins with credentials for personalized cases.

  • Review and rollout
    • Behavior change: default is "*"; to restore the old default, set pageJsonCors: false.
    • Personalized cross-origin still requires an allow-list: set pageJsonCors to a string[].
    • Scope: updates CORS header generation in packages/tanstack/src/sdk/workerEntry.ts for both GET and OPTIONS paths. Verify headers match your security requirements.

Written for commit ba6b003. Summary will update on new commits.

Review in cubic

…edentials)

?renderJson is public page data — secrets and request-derived keys are stripped
before serialization — so it should be readable cross-origin out of the box, the
same as any public API. pageJsonCors now defaults to "*" (Access-Control-Allow-
Origin: * without credentials) instead of off. `false` turns it off; a string[]
still reflects an allow-listed Origin *with* credentials for personalized cases.

Type: string[] | "*" | false. No credentials with "*" (per the CORS spec), so no
logged-in/personalized leak — the earlier off-by-default was over-cautious for
public content.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@JonasJesus42
JonasJesus42 requested a review from a team August 18, 2026 04:17
JonasJesus42 added a commit to deco-sites/docs that referenced this pull request Aug 18, 2026
Reflects decocms/blocks#476 — pageJsonCors now defaults to "*" (any origin, no
credentials) since ?renderJson is public page data. A list restricts to
credentialed origins; false disables.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@JonasJesus42
JonasJesus42 merged commit 7113410 into main Aug 18, 2026
1 check passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 7.44.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant