How to disable 'X-Frame-Options' response header in Spring Security?

前端 未结 6 2024
长情又很酷
长情又很酷 2020-11-27 12:25

I have CKeditor on my jsp and whenever I upload something, the following error pops out:

 Refused to display \'http://localhost:8080/xxx/xxx/upload-image?CKE         


        
6条回答
  •  遥遥无期
    2020-11-27 13:18

    If you're using Spring Boot, the simplest way to disable the Spring Security default headers is to use security.headers.* properties. In particular, if you want to disable the X-Frame-Options default header, just add the following to your application.properties:

    security.headers.frame=false
    

    There is also security.headers.cache, security.headers.content-type, security.headers.hsts and security.headers.xss properties that you can use. For more information, take a look at SecurityProperties.

提交回复
热议问题