Skip to content

Commit

Permalink
chore: cors filter ์ˆ˜์ •
Browse files Browse the repository at this point in the history
  • Loading branch information
drunkenhw committed Sep 29, 2023
1 parent c045710 commit 39d364a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
public class CorsFilter extends OncePerRequestFilter {
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
response.setHeader("Access-Control-Allow-Origin", "*");
String origin = request.getHeader("origin");
if (origin.endsWith(".carffe.in")) {
response.setHeader("Access-Control-Allow-Origin", origin);
}
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Methods", "*");
response.setHeader("Access-Control-Max-Age", "3600");
Expand Down

0 comments on commit 39d364a

Please sign in to comment.