You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

测试Cross-Origin-Resource-Policy(CORP)嵌入iframe未达预期效果

Cross-Origin-Resource-Policy(CORP)头验证异常问题

我正在测试网站的CORP头,确保其正常生效。已在服务器(mysite.co.in)配置Cross-Origin-Resource-Policy: same-origin头,目的是禁止本站内容被其他域名嵌入。

测试步骤:

  • 服务器配置:为mysite.co.in添加响应头Cross-Origin-Resource-Policy: same-origin
  • 跨域嵌入测试:在其他域名(如codepen)创建测试页面,代码如下:
<iframe src="https://mysite.co.in" width="1500" height="600" style="border: none;" title="Testing CORP"></iframe>

预期结果:iframe无法加载,浏览器控制台或网络标签页会显示因CORP策略被阻止的错误提示。
实际结果:mysite.co.in的内容在codepen的iframe中正常加载,未触发阻止。

内容的提问来源于stack exchange,提问作者Karamjeet Singh

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.18 21:03:09