Skip to content

Commit

Permalink
Update CorsConfig.java
Browse files Browse the repository at this point in the history
  • Loading branch information
seung-jun2 authored Jun 28, 2024
1 parent 58c88da commit 4eacded
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/main/java/com/example/healthylife/config/CorsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,6 @@ public class CorsConfig {

@Bean
public CorsFilter corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = new CorsConfiguration();

// 허용할 Origin 설정
config.addAllowedOrigin("http://ec2-43-201-150-178.ap-northeast-2.compute.amazonaws.com:8081/");
config.addAllowedOrigin("http://localhost:8081/swagger-ui/index.html");

// 모든 HTTP 메서드 허용
config.addAllowedMethod("*");

// 모든 헤더 허용
config.addAllowedHeader("*");

// 자격 증명 허용
config.setAllowCredentials(true);

// 모든 경로에 대해 위의 CORS 설정 적용
source.registerCorsConfiguration("/**", config);

// CORS 필터 반환
return new CorsFilter(source);
}
}

0 comments on commit 4eacded

Please sign in to comment.