Skip to content

Commit

Permalink
#3 Fix: fix CORS error (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
woogieon8on authored Aug 17, 2024
1 parent ac66be3 commit d9e2235
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/kahlua/KahluaProject/config/CorsMvcConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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("*"));
Expand Down

0 comments on commit d9e2235

Please sign in to comment.