zoukankan      html  css  js  c++  java
  • Spring Boot 出现 in a frame because it set 'X-Frame-Options' to 'DENY'

    在spring boot项目中出现不能加载iframe

    页面报一个"Refused to display 'http://......' in a frame because it set 'X-Frame-Options' to 'DENY'. "错误

    解决方式:

    因spring Boot采取的java config,在配置spring security的位置添加:

    @Override
    protected void configure(HttpSecurity http) throws Exception {
           http.headers().frameOptions().disable();
         http
          .csrf().disable();
         http
          .authorizeRequests()
                 .anyRequest().authenticated();
          
          http.formLogin()
              .defaultSuccessUrl("/platform/index",true)
              .loginPage("/login")
              .permitAll()
            .and()
              .logout()
               .logoutUrl("/logout");
          
          http.addFilterBefore(wiselyFilterSecurityInterceptor(),FilterSecurityInterceptor.class);
            
          
    }

    转载请说明 出处 谢谢!!!





  • 相关阅读:
    查看虚拟机里的Centos7的IP
    display:none visibility:hidden opacity:0区别
    UVA
    Gym
    Gym
    UVALive
    面试题1
    vuex的5个属性值
    vue中的.sync语法糖
    绝对定位实现垂直居中的优缺点
  • 原文地址:https://www.cnblogs.com/weitaming/p/7424333.html
Copyright © 2011-2022 走看看