Spring Boot + Spring Security 如何处理OPTIONS 403()

首先我查到的是:
https://stackoverflow.com/questions/33331042/how-to-handle-http-options-requests-in-spring-boot

但是发现按照上面几个方法都没用

我就考虑是不是Spring Security把请求拦截了:
https://stackoverflow.com/questions/21696592/disable-spring-security-for-options-http-method

果然,忘记给权限了
果断加上
.antMatchers(HttpMethod.OPTIONS, "/**").permitAll()

OK问题解决

你可能感兴趣的:(Spring Boot + Spring Security 如何处理OPTIONS 403())