Skip to content

fix(site): allow sanity.io in CSP frame-ancestors and resilient iframe visual editing - #747

Merged
codercatdev merged 1 commit into
devfrom
fix/sanity-io-frame-ancestors
Oct 17, 2026
Merged

codercatdev merged 1 commit into
devfrom
fix/sanity-io-frame-ancestors

Conversation

@codercatdev

Copy link
Copy Markdown
Contributor

Summary

  • Add https://*.sanity.io and https://sanity.io to Content-Security-Policy: frame-ancestors in apps/site/src/middleware.ts because https://codingcat-prod.sanity.studio redirects (302) to https://www.sanity.io/@ovF2qiKSO/studio/..., making https://www.sanity.io the top-level frame ancestor
  • Allow sanity-preview-perspective query param in resolvePreview() to enable draft preview even when nested cross-site cookies are blocked by the browser
  • Run enableVisualEditing() in BaseLayout.astro whenever inside an iframe (window.self !== window.top) or when draft mode is active

@github-actions

Copy link
Copy Markdown

⚡ Cloudflare Worker Preview Ready!

Environment URL
PR Preview https://aaf39ec8-codingcatdev-dev.codingcatdev.workers.dev
Dev Custom Domain https://dev.codingcat.dev
  • Worker Version ID: aaf39ec8-016a-4e2c-b3de-56946276e4fe
  • Protection: Restricted to @codingcat.dev accounts via Cloudflare Zero Trust Access

@codercatdev
codercatdev merged commit 4c7d5f8 into dev Oct 17, 2026
2 checks passed
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