文件上传时报错in a frame because it set 'X-Frame-Options' to 'deny'.

问题:

文件上传时报错:in a frame because it set 'X-Frame-Options' to 'deny'.

原因:

因为使用SpringSecurity的原因,spring Security下,X-Frame-Options默认为DENY

解决方案:

在SpringSecurity的配置类中设置一下

继承自WebSecurityConfigureAdapter

在里面的重写的configure方法中

通过入参security设置参数

作者:彼岸舞

时间:2021317

内容关于:工作中用到的小技术

本文属于作者原创,未经允许,禁止转发

原文地址:https://www.cnblogs.com/flower-dance/p/14548457.html