I have migrated from Spring boot 1.5.1.RELEASE to 2.7.1. In our project CSRF enabled, CORS enabled in 1.5.1.RELEASE too. same configurations are added here. After server start up, Able to login, Do all the GET operations, Not able to do the POST operations:
Error: Invalid CORS request. 2. 403 response code.
Tried few below things:
- In class WebConfig extends WebMvcConfigurerAdapter; registry added registry.addMapping("/**").allowedOrigins(" “).allowedMethods(“POST”,“OPTIONS”).allowCredentials(true).allowedHeaders(” ");
- http.forlogin, even permitted all.
- This issue is in only QA region, in local and DEV region. code is working fine.
- application.yml file, no much changes for the cors: cors: allow-origins: site url;
I have reverted back the code to 1.5.1.RELEASE code is working fine.
How to resolve the issue.No logs with error.