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

前端 未结 6 2066
长情又很酷
长情又很酷 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:19

    If you are using Spring Security's Java configuration, all of the default security headers are added by default. They can be disabled using the Java configuration below:

    @EnableWebSecurity
    @Configuration
    public class WebSecurityConfig extends
       WebSecurityConfigurerAdapter {
    
      @Override
      protected void configure(HttpSecurity http) throws Exception {
        http
          .headers().disable()
          ...;
      }
    }
    

提交回复
热议问题