Skip to content

Commit

Permalink
chore: same site
Browse files Browse the repository at this point in the history
  • Loading branch information
drunkenhw committed Sep 29, 2023
1 parent 15c1e7b commit 129d54e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ public class CorsFilter extends OncePerRequestFilter {
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
String origin = request.getHeader("Origin");
log.info("origine ====={}", origin);
if (origin.endsWith(".carffe.in")) {
if (!origin.isBlank() && origin.endsWith(".carffe.in")) {
response.setHeader("Access-Control-Allow-Origin", origin);
}
if (origin.isBlank()) {
response.setHeader("Access-Control-Allow-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 129d54e

Please sign in to comment.