У меня та же проблема, я реализовал интерфейс Filter
А затем разрешить Access-Control-Allow-Headers и Access-Control-Expose-Headers
к добавленной проблеме CORS
@Component
public class CORSFilter implements Filter{
@Override
public void doFilter(ServletRequest request, ServletResponse res, FilterChain chain) throws IOException, ServletException {
HttpServletResponse response = (HttpServletResponse) res;
response.setHeader("Access-Control-Allow-Origin", "*");
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE, PUT");
response.setHeader("Access-Control-Allow-Headers", "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");
response.setHeader("Access-Control-Expose-Headers", "Content-Type, Access-Control-Expose-Headers, Authorization, X-Requested-With");
chain.doFilter(request, response);
logger.info(request.getRemoteAddr());
}
}