From 967399349a70aa41bef36b11d830c626db001a7d Mon Sep 17 00:00:00 2001 From: chahyunsoo Date: Thu, 9 May 2024 13:14:33 +0900 Subject: [PATCH] =?UTF-8?q?[refactor]=20:=20CorsConfig=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/seoul/gonggong/global/config/CorsConfig.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/seoul/gonggong/global/config/CorsConfig.java b/src/main/java/seoul/gonggong/global/config/CorsConfig.java index 67ba4ff..d74a3c5 100644 --- a/src/main/java/seoul/gonggong/global/config/CorsConfig.java +++ b/src/main/java/seoul/gonggong/global/config/CorsConfig.java @@ -16,11 +16,13 @@ public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource(); CorsConfiguration configuration = new CorsConfiguration(); configuration.setAllowCredentials(true); - configuration.setAllowedOrigins(Collections.singletonList("http://localhost:3000")); + + configuration.setAllowedOrigins(Arrays.asList("http://localhost:3000", "https://bokdakbang.store")); configuration.addAllowedHeader("*"); configuration.setAllowedMethods(Arrays.asList("HEAD", "GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS")); - urlBasedCorsConfigurationSource.registerCorsConfiguration("**", configuration); + + urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", configuration); return new CorsFilter(urlBasedCorsConfigurationSource); }