Refused to display 'xxx' in a frame ,because it set 'X-Frame-Options' to 'deny'.

简介: 我本是在DJANGO页面的iframe里嵌入springboot的页面。 当报了这个错误之后,我花了时间在nginx和django上, 后来才改变解决思路,从springboot出发,解决问题。
Refused to display 'xxx' in a frame ,because it set 'X-Frame-Options' to 'deny'.

走了几次冤枉路,
我本是在DJANGO页面的iframe里嵌入springboot的页面。
当报了这个错误之后,我花了时间在nginx和django上,
后来才改变解决思路,从springboot出发,解决问题。
(其实在springboot替换页面之前,已有同样的go语言开发的页面在提供了类似服务)

b1d6ee2a8987b3f2fc057e465b21bc74acd875ce
解决问题的关键在于在HttpSecurity中禁用frameOptions即可。

protected void configure(HttpSecurity http) throws Exception {
		http.csrf().disable();
		
		http.authorizeRequests().antMatchers("POST", "/A/B").authenticated();     
		http.httpBasic().authenticationEntryPoint(basicAuthenticationPoint);
	}



目录
相关文章
|
Linux iOS开发 MacOS
pnpm全局安装报错:Run “pnpm setup“ to create it automatically, or set the global-bin-dir setting, or the PN
pnpm全局安装报错:Run “pnpm setup“ to create it automatically, or set the global-bin-dir setting, or the PN
6291 0
husky——The '.husky/pre-commit' hook was ignored because it's not set as executable
husky——The '.husky/pre-commit' hook was ignored because it's not set as executable
340 1
|
CDN
webpack——The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabled it)
webpack——The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabled it)
351 0
|
应用服务中间件 Linux BI
Tomcat部署iframe出现Refused to display ‘url‘ in a frame because it set ‘X-Frame-Options‘ to ‘deny‘无法访问问题
Tomcat部署iframe出现Refused to display ‘url‘ in a frame because it set ‘X-Frame-Options‘ to ‘deny‘无法访问问题
1672 0
Tomcat部署iframe出现Refused to display ‘url‘ in a frame because it set ‘X-Frame-Options‘ to ‘deny‘无法访问问题
|
JavaScript 前端开发
.bezierEasingMixin(); ^ Inline JavaScript is not enabled. Is it set in your op..
.bezierEasingMixin(); ^ Inline JavaScript is not enabled. Is it set in your op..
485 0
|
存储 JavaScript Java
(Python基础)新时代语言!一起学习Python吧!(四):dict字典和set类型;切片类型、列表生成式;map和reduce迭代器;filter过滤函数、sorted排序函数;lambda函数
dict字典 Python内置了字典:dict的支持,dict全称dictionary,在其他语言中也称为map,使用键-值(key-value)存储,具有极快的查找速度。 我们可以通过声明JS对象一样的方式声明dict
633 2
|
存储 缓存 JavaScript
Set和Map有什么区别?
Set和Map有什么区别?
865 1
|
编译器 C++ 容器
【c++丨STL】基于红黑树模拟实现set和map(附源码)
本文基于红黑树的实现,模拟了STL中的`set`和`map`容器。通过封装同一棵红黑树并进行适配修改,实现了两种容器的功能。主要步骤包括:1) 修改红黑树节点结构以支持不同数据类型;2) 使用仿函数适配键值比较逻辑;3) 实现双向迭代器支持遍历操作;4) 封装`insert`、`find`等接口,并为`map`实现`operator[]`。最终,通过测试代码验证了功能的正确性。此实现减少了代码冗余,展示了模板与仿函数的强大灵活性。
484 2
|
存储 JavaScript 前端开发
for...of循环在遍历Set和Map时的注意事项有哪些?
for...of循环在遍历Set和Map时的注意事项有哪些?
914 156