@ Override public void doFilter ( ServletRequest req , ServletResponse res , FilterChain chain ) throws IOException , ServletException { HttpServletResponse response = ( HttpServletResponse ) res ; response . setHeader ( "Access-Control-Allow-Origin" , allowOrigin ) ; response . setHeader ( "Access-Control-Allow-Methods" , allowMethod ) ; response . setHeader ( "Access-Control-Max-Age" , maxAge ) ; response . setHeader ( "Access-Control-Allow-Headers" , allowHeaders ) ; chain . doFilter ( req , res ) ; }
Sets the headers to support CORS