Skip to content

Commit

Permalink
[manager] fix cross domain problem in SecurityCorsConfiguration (#469)
Browse files Browse the repository at this point in the history
Cross domain problem fix
  • Loading branch information
zenan08 authored Nov 28, 2022
1 parent 8397fef commit bc8a120
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,12 @@
@Configuration
public class SecurityCorsConfiguration {

private static final String ORIGIN_PATTERN = "http://localhost:*";

@Bean
public FilterRegistrationBean corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration corsConfiguration = new CorsConfiguration();
corsConfiguration.setAllowCredentials(true);
corsConfiguration.setAllowedOriginPatterns(Collections.singletonList(ORIGIN_PATTERN));
corsConfiguration.setAllowedOriginPatterns(Collections.singletonList(CorsConfiguration.ALL));
corsConfiguration.addAllowedHeader(CorsConfiguration.ALL);
corsConfiguration.addAllowedMethod(CorsConfiguration.ALL);
source.registerCorsConfiguration("/**", corsConfiguration);
Expand Down

0 comments on commit bc8a120

Please sign in to comment.