Spring CSRF token does not work, when the request to be sent is a multipart request

前端 未结 5 571
情歌与酒
情歌与酒 2020-11-27 22:24

I use,

  • Spring Framework 4.0.0 RELEASE (GA)
  • Spring Security 3.2.0 RELEASE (GA)
  • Struts 2.3.16

In which, I use an in-built securi

5条回答
  •  迷失自我
    2020-11-27 22:59

    You can disable csrf - httpSecurity.csrf().disable();

     @Configuration
        public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
    
        @Override
        protected void configure(HttpSecurity httpSecurity) throws Exception {
            ...
            httpSecurity.csrf().disable();
            ...
        }
    }
    

提交回复
热议问题