Skip to content

Commit 0c896fe

Browse files
committed
fix : CORS 설정 변경
1 parent 0214281 commit 0c896fe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

api/src/main/java/com/mbtips/common/controller/HealthCheckController.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
@RestController
1010
@RequiredArgsConstructor
1111
@RequestMapping("/health-check")
12-
@CrossOrigin(origins = "*", allowedHeaders = "*", methods = {RequestMethod.GET})
1312
@Tag(name = "L7 health-check", description = "L7 health-check API")
1413
public class HealthCheckController {
1514

core/src/main/java/com/mbtips/common/configuration/SecurityConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class SecurityConfiguration {
3535
@Bean
3636
public SecurityFilterChain configure(HttpSecurity http) throws Exception {
3737
return http.csrf(AbstractHttpConfigurer::disable)
38-
.cors(Customizer.withDefaults())
38+
.cors(cors -> cors.configurationSource(corsConfiguration()))
3939
.sessionManagement(session -> session.sessionCreationPolicy(STATELESS))
4040
.formLogin(AbstractHttpConfigurer::disable)
4141
.addFilterBefore(new JwtAuthenticationFilter(jwtProvider, objectMapper), UsernamePasswordAuthenticationFilter.class)
@@ -49,6 +49,7 @@ public CorsConfigurationSource corsConfiguration() {
4949
corsConfiguration.setAllowedOrigins(List.of(
5050
"*"
5151
));
52+
corsConfiguration.setAllowCredentials(false);
5253
corsConfiguration.setAllowedHeaders(List.of("*"));
5354
corsConfiguration.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "PATCH"));
5455
UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource();

0 commit comments

Comments
 (0)