@@ -0,0 +1,1250 @@
+package com.justjournal.filter;%0A%0Aimport org.springframework.core.Ordered;%0Aimport org.springframework.core.annotation.Order;%0Aimport org.springframework.stereotype.Component;%0A%0Aimport javax.servlet.*;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0Aimport java.io.IOException;%0A%0A/**%0A * @author Lucas Holt%0A */%0A@Component%0A@Order(Ordered.HIGHEST_PRECEDENCE)%0Apublic class SimpleCorsFilter implements Filter %7B%0A%0A%09/** %7B@inheritDoc%7D */%0A%09public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException %7B%0A%09%09HttpServletResponse response = (HttpServletResponse) res;%0A%09%09HttpServletRequest request = (HttpServletRequest) req;%0A%0A%09%09response.setHeader(%22Access-Control-Allow-Origin%22, %22*%22);%0A%09%09response.setHeader(%22Access-Control-Allow-Methods%22, %22POST, GET, OPTIONS, DELETE, PUT, PATCH%22);%0A%09%09response.setHeader(%22Access-Control-Max-Age%22, %223600%22);%0A%09%09response.setHeader(%22Access-Control-Allow-Headers%22, %22x-auth-token, x-requested-with, accept, authorization, content-type%22);%0A%0A%09%09if (!request.getMethod().equals(%22OPTIONS%22)) chain.doFilter(req, res);%0A%09%7D%0A%0A%09/** %7B@inheritDoc%7D */%0A%09public void init(FilterConfig filterConfig) %7B%7D%0A%0A%09/**%0A%09 * %3Cp%3Edestroy.%3C/p%3E%0A%09 */%0A%09public void destroy() %7B%7D%0A%0A%7D%0A

add CORS filter v1