From 11d3efdb310720d9a37fec3f827a6be7eef12abd Mon Sep 17 00:00:00 2001 From: hyxklee Date: Tue, 8 Oct 2024 16:30:24 +0900 Subject: [PATCH] =?UTF-8?q?HOTFIX:=20CORS=20=EC=99=80=EC=9D=BC=EB=93=9C?= =?UTF-8?q?=EC=B9=B4=EB=93=9C=EB=A1=9C=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../leets/weeth/global/config/SecurityConfig.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/leets/weeth/global/config/SecurityConfig.java b/src/main/java/leets/weeth/global/config/SecurityConfig.java index caff488c..8a035c98 100644 --- a/src/main/java/leets/weeth/global/config/SecurityConfig.java +++ b/src/main/java/leets/weeth/global/config/SecurityConfig.java @@ -91,13 +91,13 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { @Bean - public CorsConfigurationSource corsConfigurationSource() { + public CorsConfigurationSource source() { CorsConfiguration configuration = new CorsConfiguration(); - - configuration.setAllowedOrigins(Arrays.asList("http://localhost:3000")); - configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PATCH", "DELETE")); - configuration.setAllowedHeaders(Arrays.asList("*")); - configuration.setExposedHeaders(Arrays.asList("Authorization, Authorization_refresh")); + configuration.addAllowedOriginPattern("*"); + configuration.addAllowedHeader("*"); + configuration.addAllowedMethod("*"); + configuration.addExposedHeader("Authorization"); + configuration.addExposedHeader("Authorization_refresh"); configuration.setAllowCredentials(true); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();