In a frame because it set 'X-Frame-Options' to 'SAMEORIGIN, SAMEORIGIN'

感情迁移 提交于 2021-01-20 20:35:15

问题


<a href="#popupVideo" data-rel="popup" data-position-to="window" class="ui-btn ui-corner-all ui-shadow ui-btn-inline">Launch video player</a>
<div data-role="popup" id="popupVideo" data-overlay-theme="b" data-theme="a" data-tolerance="15,15" class="ui-content">
    <iframe src="https://xxxx.net" width="497" height="298" seamless=""></iframe>
</div>

I am trying to add an iframe in the pop up window but its showing me the error In a frame because it set 'X-Frame-Options' to 'SAMEORIGIN, SAMEORIGIN'.

What to do now ?


回答1:


Solved it by changing the file httpd.conf

<IfModule headers_module> 
 <IfVersion >= 2.4.7 > 
  Header always setifempty X-Frame-Options SAMEORIGIN
 </IfVersion>
 <IfVersion < 2.4.7 > 
  Header always merge X-Frame-Options SAMEORIGIN 
 </IfVersion> 
 RequestHeader unset Proxy 
</IfModule>



回答2:


Looks like https://xxxx.net's owner doesn't want anyone to iFrame his resources on their websites.

If that domain is yours and you want to include its content into another your website, you should whitelist it using ALLOW-FROM https://your-domain.com.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options



来源:https://stackoverflow.com/questions/40522747/in-a-frame-because-it-set-x-frame-options-to-sameorigin-sameorigin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!