2021
10-25
10-25
spring cloud gateway跨域全局CORS配置方式
在Spring5Webflux中,配置CORS,可以通过自定义WebFilter实现:注:此种写法需真实跨域访问,监控header中才会带相应属性。代码实现方式importorg.springframework.http.HttpHeaders;importorg.springframework.http.HttpStatus;importorg.springframework.http.server.reactive.ServerHttpRequest;importorg.springframework.http.server.reactive.ServerHttpResponse;importorg.springframework.web.cors.reactive.CorsUt...
继续阅读 >