fix(preview): stop frame-policy conflicts and enforce canonical host #52
Reference in New Issue
Block a user
Delete Branch "fix/wagtail-preview-frame-policy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
X-Frame-Options: DENYfrom Caddy config (conflicted with DjangoSAMEORIGIN)www.nohypeai.net -> nohypeai.netredirect to keep preview same-originSite.hostnamefromWAGTAILADMIN_BASE_URLhost first, then fallback toALLOWED_HOSTS[0]Why
Wagtail preview renders in an iframe and is sensitive to frame policy + exact origin matching. Deployed responses were emitting both
DENYandSAMEORIGIN, and host mismatches (wwwvs apex) could still break preview intermittently.Validation
sh -n deploy/entrypoint.prod.shcaddy validate --config deploy/caddy/nohype.caddy --adapter caddyfile