public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain) throws IOException, ServletException {
HttpServletRequest request= (HttpServletRequest) servletRequest;
HttpServletResponse response= (HttpServletResponse) servletResponse;
String origin=request.getHeader("origin");
if (origin!=null) response.addHeader(ACCESS_CONTROL_ALLOW_ORIGIN, origin);
else response.addHeader(ACCESS_CONTROL_ALLOW_ORIGIN, "*");
response.addHeader(ACCESS_CONTROL_ALLOW_CREDENTIALS, "true");
// Allow all forms of requests
final Enumeration aclMethods = request.getHeaders(ACCESS_CONTROL_REQUEST_METHOD);