From bab1d50fc84ad0274e3401acb2079b392de39113 Mon Sep 17 00:00:00 2001 From: Lauro Correia Silveira Date: Wed, 20 Dec 2023 09:23:10 +0100 Subject: [PATCH] Setup Cros configuration to allow between railway and spring requests (#85) --- .../infraestructure/security/SecurityConfigurations.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/alura/aluraflixapi/infraestructure/security/SecurityConfigurations.java b/src/main/java/com/alura/aluraflixapi/infraestructure/security/SecurityConfigurations.java index 28641fb..95fd5f2 100644 --- a/src/main/java/com/alura/aluraflixapi/infraestructure/security/SecurityConfigurations.java +++ b/src/main/java/com/alura/aluraflixapi/infraestructure/security/SecurityConfigurations.java @@ -62,7 +62,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { @Bean public CorsConfigurationSource corsConfigurationSource() { CorsConfiguration configuration = new CorsConfiguration(); - configuration.setAllowedOrigins(List.of("https://alura-flix-api-production.up.railway.app")); + configuration.setAllowedOrigins(List.of("http://alura-flix-api-production.up.railway.app")); configuration.setAllowedMethods(Arrays.asList("GET","POST")); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); source.registerCorsConfiguration("/**", configuration);