@@ -0,0 +1,1569 @@
+package com.rizki.mufrizal.belajar.oauth2.filter;%0A%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@Component%0Apublic class CORSFilter implements Filter %7B%0A%0A    @Override%0A    public void init(FilterConfig filterConfig) throws ServletException %7B%0A%0A    %7D%0A%0A    @Override%0A    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException %7B%0A        HttpServletResponse httpServletResponse = (HttpServletResponse) response;%0A        HttpServletRequest httpServletRequest = (HttpServletRequest) request;%0A        httpServletResponse.setHeader(%22Access-Control-Allow-Origin%22, %22*%22);%0A        httpServletResponse.setHeader(%22Access-Control-Allow-Methods%22, %22POST, GET, OPTIONS, DELETE%22);%0A        httpServletResponse.setHeader(%22Access-Control-Max-Age%22, %223600%22);%0A        httpServletResponse.setHeader(%22Access-Control-Allow-Headers%22, %22accept, authorization, x-requested-with, content-type%22);%0A%0A        if (httpServletRequest.getMethod().equals(%22OPTIONS%22)) %7B%0A            try %7B%0A                httpServletResponse.setStatus(200);%0A                httpServletResponse.getWriter().print(%22OK%22);%0A                httpServletResponse.getWriter().flush();%0A            %7D catch (IOException ignored) %7B%0A                ignored.printStackTrace();%0A            %7D%0A        %7D else %7B%0A            chain.doFilter(request, response);%0A        %7D%0A    %7D%0A%0A    @Override%0A    public void destroy() %7B%0A%0A    %7D%0A%7D%0A

Add COSRFilter