From d9e22357d81f94b662a12e85e3d851cbe787f78d Mon Sep 17 00:00:00 2001 From: woogieon8on <140885810+woogieon8on@users.noreply.github.com> Date: Sat, 17 Aug 2024 20:19:55 +0900 Subject: [PATCH] #3 Fix: fix CORS error (#62) --- src/main/java/kahlua/KahluaProject/config/CorsMvcConfig.java | 3 ++- src/main/java/kahlua/KahluaProject/config/SecurityConfig.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/kahlua/KahluaProject/config/CorsMvcConfig.java b/src/main/java/kahlua/KahluaProject/config/CorsMvcConfig.java index fb07142..79eb33c 100644 --- a/src/main/java/kahlua/KahluaProject/config/CorsMvcConfig.java +++ b/src/main/java/kahlua/KahluaProject/config/CorsMvcConfig.java @@ -11,6 +11,7 @@ public class CorsMvcConfig implements WebMvcConfigurer { public void addCorsMappings(CorsRegistry corsRegistry) { corsRegistry.addMapping("/**") - .allowedOrigins("http://localhost:3000", "https://kahluaband.com/", "http://kahluaband.com/", "https://kahluabandver20-caminobelllos-projects.vercel.app"); + .allowedOrigins("http://localhost:3000", "https://kahluaband.com/", "http://kahluaband.com/", + "https://www.kahluaband.com/", "http://www.kahluaband.com/", "https://kahluabandver20-caminobelllos-projects.vercel.app"); } } \ No newline at end of file diff --git a/src/main/java/kahlua/KahluaProject/config/SecurityConfig.java b/src/main/java/kahlua/KahluaProject/config/SecurityConfig.java index e131ee1..a0ec949 100644 --- a/src/main/java/kahlua/KahluaProject/config/SecurityConfig.java +++ b/src/main/java/kahlua/KahluaProject/config/SecurityConfig.java @@ -63,7 +63,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { CorsConfigurationSource corsConfigurationSource() { CorsConfiguration config = new CorsConfiguration(); config.setAllowCredentials(true); - config.setAllowedOrigins(List.of("http://localhost:8080", "http://kahluaband.com", "https://kahluaband.com", "http://localhost:3000", "https://kahluabandver20-caminobelllos-projects.vercel.app")); + config.setAllowedOrigins(List.of("http://localhost:8080", "http://kahluaband.com", "https://kahluaband.com", "http://localhost:3000", "https://www.kahluaband.com/", "http://www.kahluaband.com/", "https://kahluabandver20-caminobelllos-projects.vercel.app")); config.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS")); config.setAllowedHeaders(List.of("*")); config.setExposedHeaders(List.of("*"));