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 and tomsun28 committed Dec 4, 2022
1 parent 2a8e1ee commit 24172b5
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 24172b5

Please sign in to comment.