Spring Global CORS configuration not working but Controller level config does

后端 未结 10 1077
臣服心动
臣服心动 2020-12-14 06:25

I am trying to configure CORS globally via WebMvcConfigurerAdapter shown below. To test I am hitting my API endpoint via a small node app I created to emulate a

10条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-14 06:57

    I faced similar issue. I changed the WebMvcConfigurerAdapter to WebMvcConfigurationSupport and it started working.

    In addition to this I also moved the RequestMappingHandlerMapping defined in xml configuration file to java configuration.

提交回复
热议问题