优化跨域

taobao_model
tanghc 5 years ago
parent 760adf0f6d
commit 44f5506375
  1. 4
      sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/AbstractConfiguration.java

@ -197,12 +197,12 @@ public class AbstractConfiguration implements ApplicationContextAware, Applicati
}
/**
* 跨域过滤器gateway
* 跨域过滤器gateway采用react形式需要使用reactive包下的UrlBasedCorsConfigurationSource
*/
@Bean
@ConditionalOnMissingBean
@ConditionalOnProperty("sop.gateway-index-path")
public CorsWebFilter corsFilterReact() {
public CorsWebFilter corsWebFilter() {
org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource source = new org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", createCorsConfiguration());
return new CorsWebFilter(source);

Loading…
Cancel
Save