首页 > 编程语言 > 详细

Spring boot X-Frame-Options 异常 a frame because it set 'X-Frame-Options' to 'deny'

时间:2020-02-08 18:55:28      阅读:513      评论:0      收藏:0      [点我收藏+]

a frame because it set ‘X-Frame-Options‘ to ‘deny‘

在spring security配置的位置添加

http.headers().frameOptions().disable();

    protected void configure(HttpSecurity http) throws Exception {
        http.headers().frameOptions().disable();
        http.authorizeRequests()
                .antMatchers("/login", "/logout", "/getVerifyCode", "/validateVerifyCode")
                .permitAll()
                .anyRequest().authenticated()

                .and()
                .formLogin()
                .loginPage("/login")
                .successForwardUrl("/success")
                .failureForwardUrl("/failure")

                .and()
                .logout()
                .logoutUrl("/logout")
                .invalidateHttpSession(true)

                .and()
                .csrf().disable();
    }

 

Spring boot X-Frame-Options 异常 a frame because it set 'X-Frame-Options' to 'deny'

原文:https://www.cnblogs.com/yangchongxing/p/12284022.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!