WebChat embed test
驗證 allowed_embed_origins → CSP frame-ancestors 是否真的擋得住跨網域嵌入。
此頁面的 origin(貼進 allowed_embed_origins)
…
嵌入目標
…
怎麼判讀
- 允許(此 origin 在白名單):下方 iframe 正常顯示聊天畫面。
- 阻擋(不在白名單):iframe 一片空白,且 DevTools Console 出現
Refused to display … because an ancestor violates … frame-ancestors。 - iframe 有畫面但送不出訊息 ≠ CSP 生效,那是 API 層的 origin 檢查,不是這次要驗的東西。
前置:
chat-dev.maiagent.ai 的公開 DNS 指向 Cloudflare,不會經過掛了
frame-ancestors function 的 CloudFront。測試機請先在 /etc/hosts 加上
54.192.248.37 chat-dev.maiagent.ai,測完移除。