| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,11 +22,27 @@ | |||
| 22 | 22 | **/ | |
| 23 | 23 | @Component | |
| 24 | 24 | public class CORSFilter implements Filter { | |
| 25 | + | ||
| 26 | + | ||
| 27 | + /** | ||
| 28 | + * 初始化 | ||
| 29 | + * | ||
| 30 | + * @param filterConfig filterConfig | ||
| 31 | + * @throws ServletException | ||
| 32 | + */ | ||
| 25 | 33 | @Override | |
| 26 | 34 | public void init(FilterConfig filterConfig) throws ServletException { | |
| 27 | 35 | ||
| 28 | 36 | } | |
| 29 | 37 | ||
| 38 | + /** | ||
| 39 | + * CORS 过滤器 | ||
| 40 | + * @param req rq | ||
| 41 | + * @param res res | ||
| 42 | + * @param chain chin | ||
| 43 | + * @throws IOException | ||
| 44 | + * @throws ServletException | ||
| 45 | + */ | ||
| 30 | 46 | public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { | |
| 31 | 47 | HttpServletResponse response = (HttpServletResponse) res; | |
| 32 | 48 | response.setHeader("Access-Control-Allow-Origin", "*"); | |
@@ -36,6 +52,10 @@ public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) | |||
| 36 | 52 | chain.doFilter(req, res); | |
| 37 | 53 | } | |
| 38 | 54 | ||
| 55 | + | ||
| 56 | + /** | ||
| 57 | + * 销毁对象 | ||
| 58 | + */ | ||
| 39 | 59 | public void destroy() { | |
| 40 | 60 | } | |
| 41 | 61 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments