Skip to content

Commit

Permalink
Setup Cros configuration to allow between railway and spring requests (
Browse files Browse the repository at this point in the history
  • Loading branch information
LauroSilveira committed Dec 20, 2023
1 parent a094ecc commit 5362923
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ 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.setAllowedMethods(Arrays.asList("GET","POST"));
configuration.setAllowedOrigins(List.of("*"));
configuration.setAllowedMethods(List.of("*"));
configuration.setAllowedHeaders(List.of("*"));
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", configuration);
return source;
Expand Down

0 comments on commit 5362923

Please sign in to comment.