소스 검색

style(cors): CORS配置简化。

删除CorsWebFilter,使用gateway配置文件的方式配置CORS。
liuzhuoming23 6 년 전
부모
커밋
7e213fe84d
2개의 변경된 파일0개의 추가작업 그리고 30개의 파일을 삭제
  1. 0 1
      febs-cloud/sql/febs_nacos.sql
  2. 0 29
      febs-gateway/src/main/java/cc/mrbird/febs/gateway/configure/FebsGateWayCorsConfigure.java

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 1
febs-cloud/sql/febs_nacos.sql


+ 0 - 29
febs-gateway/src/main/java/cc/mrbird/febs/gateway/configure/FebsGateWayCorsConfigure.java

@@ -1,29 +0,0 @@
-package cc.mrbird.febs.gateway.configure;
-
-import cc.mrbird.febs.common.entity.constant.EndpointConstant;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.cors.CorsConfiguration;
-import org.springframework.web.cors.reactive.CorsWebFilter;
-import org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource;
-import org.springframework.web.util.pattern.PathPatternParser;
-
-/**
- * @author MrBird
- */
-@Configuration
-public class FebsGateWayCorsConfigure {
-
-    @Bean
-    public CorsWebFilter corsFilter() {
-        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(new PathPatternParser());
-        CorsConfiguration cors = new CorsConfiguration();
-        cors.setAllowCredentials(true);
-        cors.addAllowedOrigin(CorsConfiguration.ALL);
-        cors.addAllowedHeader(CorsConfiguration.ALL);
-        cors.addAllowedMethod(CorsConfiguration.ALL);
-        source.registerCorsConfiguration(EndpointConstant.ALL, cors);
-        return new CorsWebFilter(source);
-    }
-
-}

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.