From 6feceeda2270958d219ec625cd1441292d62353f Mon Sep 17 00:00:00 2001 From: aeeazip Date: Wed, 23 Aug 2023 03:43:53 +0900 Subject: [PATCH] =?UTF-8?q?fix(#125)=20:=20cors=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/trothly/trothcam/config/SecurityConfig.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/trothly/trothcam/config/SecurityConfig.java b/src/main/java/trothly/trothcam/config/SecurityConfig.java index 42747ed..ca4e8da 100644 --- a/src/main/java/trothly/trothcam/config/SecurityConfig.java +++ b/src/main/java/trothly/trothcam/config/SecurityConfig.java @@ -87,11 +87,11 @@ protected CorsConfigurationSource corsConfigurationSource() { private CorsConfiguration getDefaultCorsConfiguration() { CorsConfiguration configuration = new CorsConfiguration(); - configuration.setAllowedOriginPatterns( + configuration.setAllowedOrigins( Arrays.asList("http://localhost:8080", "https://trothly.com", "http://localhost:3000")); configuration.setAllowedHeaders(Arrays.asList("*")); // 모든 header 에 응답을 허용 configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "PATCH")); // 모든 get,post,patch,put,delete 요청 허용 - // configuration.setAllowedOrigins(Arrays.asList("*")); // 모든 ip 응답을 허용 + configuration.setAllowedOrigins(Arrays.asList("*")); // 모든 ip 응답을 허용 configuration.setAllowCredentials(true); // 내 서버가 응답할 때 json 을 자바스크립트에서 처리할 수 있게 할지를 설정하는 것 configuration.setMaxAge(3600L);