Skip to content

Commit

Permalink
Merge pull request #29 from ktb1-eight/eqvyoo-patch-1
Browse files Browse the repository at this point in the history
Update WebConfig.java
  • Loading branch information
KimGyeongLock authored Sep 18, 2024
2 parents b34c0d3 + 893b952 commit 96bc120
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main/java/com/example/bami/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.requestMatchers("/ai/**").permitAll()
.requestMatchers("/api/**").permitAll()
.requestMatchers("/").permitAll()
.requestMatchers("/actuator/health").permitAll() // 헬스 체크 허용 추가
// Swagger 관련 경로들에 대해 접근을 허용합니다.
.requestMatchers("/swagger-ui/**", "/v3/api-docs/**").permitAll()
.anyRequest().authenticated() // 그 외의 모든 요청은 인증된 사용자만 접근
Expand All @@ -40,4 +41,4 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
public JwtAuthenticationFilter jwtAuthenticationFilter() {
return new JwtAuthenticationFilter(tokenProvider);
}
}
}
4 changes: 2 additions & 2 deletions src/main/java/com/example/bami/config/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ public class WebConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**") // 모든 API 경로에 대해 CORS 설정
.allowedOrigins(allowedOrigin)
.allowedOrigins(allowedOrigin, "https://www.bamiweb.com","http://www.bamiweb.com")
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
.allowedHeaders("*")
.allowCredentials(true)
.maxAge(3600);
}
}
}

0 comments on commit 96bc120

Please sign in to comment.