Response for preflight has invalid HTTP status code 401 - Spring

前端 未结 4 523
情深已故
情深已故 2020-12-03 15:11

everyone. I\'m new to Angular 2 and Spring Framework. I\'m trying a simple get request with an authorization header (basic auth).

I\'m using Spring Boot (1.2.6.RELEA

4条回答
  •  孤街浪徒
    2020-12-03 15:20

    This could be very late but this could solve some ones problem, after long hours i found the answer

    public class SecurityConfig extends WebSecurityConfigurerAdapter
    {
        @Override
        public void configure( WebSecurity web ) throws Exception
        {
            web.ignoring().antMatchers( HttpMethod.OPTIONS, "/**" );
        }
    }
    

    Refer https://stackoverflow.com/a/45830981/3724760

提交回复
热议问题