Repository navigation
fix(blocks): allow staging as a default draft-preview API domain - #432
Merged
Merged
Conversation
DEFAULT_PREVIEW_API_DOMAINS only listed .preview-studio.decocms.com (production). Studio's staging environment serves the draft content API under a different, non-matching suffix, .preview-studio-stg.decocms.com — -stg is its own label, not a substring match of the production domain — so previewApiOriginForHost silently rejected every staging draft pointer and resolveDraftDecofile fell back to published content with no visible error anywhere. Both are deco-operated, same as the existing entries, so this adds no new SSRF surface. Co-Authored-By: Claude Sonnet 5 <[email protected]>
|
🎉 This PR is included in version 7.31.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
Summary
DEFAULT_PREVIEW_API_DOMAINSonly listed.preview-studio.decocms.com(production). Studio's staging environment serves the draft content API under.preview-studio-stg.decocms.com— a different suffix (-stgis its own label, not a substring match) — sopreviewApiOriginForHostsilently rejected every staging draft pointer andresolveDraftDecofilefell back to published content with zero visible error..preview-studio-stg.decocms.comto the default list, alongside the existing production entry. Both are deco-operated, so this adds no new SSRF surface (same rationale as the existing entries).Found while validating decocms/studio#5363 (pull-based Fast Preview) against Studio's staging environment: the sandbox daemon and Studio backend were both healthy and serving the correct content, but the deployed site's server-side fetch of the draft decofile never fired because the staging domain didn't match the allowlist.
Test plan
previewApiOriginForHost's existing test asserting the staging suffix resolves correctlyDEFAULT_PREVIEW_API_DOMAINScontract testbun test packages/blocks/src/cms/draftSource.test.ts— 28/28 passbun run --filter='./packages/blocks' typecheck— cleanbun test packages/blockshas the same 107 pre-existing failures (unrelated migration-template tests) with and without this change🤖 Generated with Claude Code
Summary by cubic
Allow staging draft-preview API domain by default to stop silent fallbacks to published content on Studio staging. Adds
.preview-studio-stg.decocms.comtoDEFAULT_PREVIEW_API_DOMAINSso staging draft pointers resolve viapreviewApiOriginForHost..preview-studio-stg.decocms.comalongside.preview-studio.decocms.cominDEFAULT_PREVIEW_API_DOMAINS(both deco-operated; no new SSRF surface).previewApiOriginForHost; update the default domains contract test.Written for commit adfaa8b. Summary will update on new commits.