From 722cbe30587096fba9457fea1d0d821ce98da79c Mon Sep 17 00:00:00 2001 From: 1223v <1223v@naver.com> Date: Mon, 20 Nov 2023 03:37:19 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20Cors=20=ED=97=88=EC=9A=A9=20=ED=97=A4?= =?UTF-8?q?=EB=8D=94=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../readyverydemo/security/config/SpringSecurityConfig.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/readyvery/readyverydemo/security/config/SpringSecurityConfig.java b/src/main/java/com/readyvery/readyverydemo/security/config/SpringSecurityConfig.java index 064dc7a..2cc360a 100644 --- a/src/main/java/com/readyvery/readyverydemo/security/config/SpringSecurityConfig.java +++ b/src/main/java/com/readyvery/readyverydemo/security/config/SpringSecurityConfig.java @@ -98,6 +98,11 @@ CorsConfigurationSource corsConfigurationSource() { configuration.setAllowedOrigins(Arrays.asList("*")); configuration.setAllowedMethods(Arrays.asList("POST", "PATCH", "GET", "DELETE")); + // TODO: 이 부분은 나중에 삭제해야 됨 + //configuration.setAllowedMethods(Arrays.asList("*")); // 모든 HTTP 메서드 허용 + configuration.setAllowedHeaders(Arrays.asList("*")); // 모든 헤더 허용 + configuration.setAllowCredentials(true); // 크레덴셜(쿠키, HTTP 인증 등) 허용 + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); source.registerCorsConfiguration("/**", configuration); return source;