Skip to content

Commit

Permalink
Fix: Cors 허용 헤더 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
1223v committed Nov 19, 2023
1 parent bb3f44a commit 722cbe3
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ CorsConfigurationSource corsConfigurationSource() {
configuration.setAllowedOrigins(Arrays.asList("*"));
configuration.setAllowedMethods(Arrays.asList("POST", "PATCH", "GET", "DELETE"));

// TODO: 이 부분은 나중에 삭제해야 됨
//configuration.setAllowedMethods(Arrays.asList("*")); // 모든 HTTP 메서드 허용
configuration.setAllowedHeaders(Arrays.asList("*")); // 모든 헤더 허용
configuration.setAllowCredentials(true); // 크레덴셜(쿠키, HTTP 인증 등) 허용

UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", configuration);
return source;
Expand Down

0 comments on commit 722cbe3

Please sign in to comment.