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 6903789 commit 2379720
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.carffeine.carffeine.web;

import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpMethod;
import org.springframework.web.filter.OncePerRequestFilter;

Expand All @@ -10,10 +11,12 @@
import java.io.IOException;
import java.util.Objects;

@Slf4j
public class CorsFilter extends OncePerRequestFilter {
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
String origin = request.getHeader("Referer");
String origin = request.getHeader("Origin");
log.info("origine ====={}", origin);
if (origin.endsWith(".carffe.in")) {
response.setHeader("Access-Control-Allow-Origin", origin);
}
Expand Down

0 comments on commit 2379720

Please sign in to comment.