Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update WebConfig.java #29

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}
}
Loading