您现在的位置:首页 >> 前端 >> 内容

SpringSecurityiFrame'X-Frame-Options'to'deny'报错的解决方法

时间:2018/3/22 14:36:55 点击:

  核心提示:报错信息如下:Refused to display https://localhost:8080/msc/ordertype in a frame because it set X-Frame-Opt...

报错信息如下:
Refused to display ‘https://localhost:8080/msc/ordertype’ in a frame because it set ‘X-Frame-Options’ to ‘deny’.

原因:
Spring-Security 默认是设置了这个 “X-Frame-Options” 属性为DENY

解决:在http配置中设置


        
            <frame-options policy="SAMEORIGIN">
        </frame-options>
    

X-Frame-Options:
他的值有三个:

(1)DENY — 表示该页面不允许在 frame 中展示,即便是在相同域名的页面中嵌套也不允许。

(2)SAMEORIGIN — 表示该页面可以在相同域名页面的 frame 中展示。

(3)ALLOW-FROM https://example.com/ — 表示该页面可以在指定来源的 frame 中展示。

Tags:SP PR RI IN 
作者:网络 来源:多多的博客