Skip to content

Commit

Permalink
Merge pull request #168 from kakao-tech-campus-2nd-step3/fix/#150-ref…
Browse files Browse the repository at this point in the history
…reshTokenCookie

[fix] credential request를 기반한 cors 설정
  • Loading branch information
sanghee0820 authored Nov 14, 2024
2 parents 06e54a0 + 7968faa commit 7d66efe
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/main/java/team7/inplace/security/config/CorsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,20 @@ public CorsFilter corsFilter() {
config.setAllowCredentials(true);
config.addAllowedOrigin("https://www.inplace.my");
config.addAllowedOriginPattern("https://api.inplace.my");
config.addAllowedHeader("*");
config.addAllowedMethod("*");
config.addAllowedHeader("Origin");
config.addAllowedHeader("Accept");
config.addAllowedHeader("X-Requested-With");
config.addAllowedHeader("Content-Type");
config.addAllowedHeader("Access-Control-Request-Method");
config.addAllowedHeader("Access-Control-Request-Headers");
config.addAllowedHeader("Authorization");
config.addAllowedMethod("GET");
config.addAllowedMethod("POST");
config.addAllowedMethod("PUT");
config.addAllowedMethod("DELETE");
config.addAllowedMethod("OPTIONS");
config.addAllowedHeader("PATCH");
config.addAllowedMethod("HEAD");
source.registerCorsConfiguration("/**", config);
return new CorsFilter(source);
}
Expand Down

0 comments on commit 7d66efe

Please sign in to comment.