java.lang.IllegalArgumentException: When allowCredentials is true, allowedOrigins cannot contain
the special value "*" since that cannot be set on the "Access-Control-Allow-Origin" response
header. To allow credentials to a set of origins, list them explicitly or consider using "allowedOriginPatterns" instead.
at org.springframework.web.cors.CorsConfiguration.validateAllowCredentials(CorsConfiguration.java:460)
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
|_ checkpoint ⇢ org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter [DefaultWebFilterChain][from www.fhadmin.cn]
The reason for the problem is that the new version of gateway cancels allowedorigins and the corresponding change is allowedOriginPatterns
The configuration is modified to:
#--------gateway config---fhadmin.cn-----
spring.cloud.gateway.discovery.locator.enabled=true
spring.cloud.gateway.discovery.locator.lower-case-service-id=true
#(java fhadmin.cn)
spring.cloud.gateway.globalcors.corsConfigurations.[/**].allowedOriginPatterns=*
spring.cloud.gateway.globalcors.corsConfigurations.[/**].allowedHeaders=*
spring.cloud.gateway.globalcors.corsConfigurations.[/**].allowedMethods=*
spring.cloud.gateway.globalcors.corsConfigurations.[/**].allowCredentials=true
Read More:
- spring cloud 2020 gateway Error 503 [How to Solve]
- Problems in springboot upgrade 2.4.0: when allowcredentials is true, allowedorigins cannot contain the specia
- Spring Cloud Hoxton.SR9 gateway and reactor-netty 0.9.0.RELEASE is Incompatible [How to Solve]
- Springcloud builds a gateway and starts Error [Solved]
- Zuul Gateway Failed to Import Dependency [How to Solve]
- Solution to the problem of using Alibaba gateway but unable to route successfully
- Java parsing xml file encounters special symbols & will be abnormal solutions
- Spring cloud remote connect Nacos error [How to Solve]
- How to Solve Swagger error: IllegalStateException
- springcloud alibaba Integrating nacos reports errors: create config service error!properties=NacosConfigPropertie
- [Solved] Spring Cloud Use Ribbon Error: No instances available for XXX
- [Solved] Openfegn Remote Call Error: java.lang.NullPointerException: null
- SpringCloud: Error creating bean with name ‘configurationPropertiesBeans‘
- [Solved] nacos Startup Error: Unable to start embedded Tomcat
- [Solved] Failed to start bean ‘eurekaAutoServiceRegistration‘; nested exception is java.lang.NullPointerExce
- [Solved] BeanCreationException: Error creating bean with name ‘configurationPropertiesBeans‘
- Error creating bean with name ‘servletEndpointRegistrar‘ defined in class path resource
- [Solved] JSONUtil.toJsonStr() Error: org.springframework.web.util.NestedServletException: Handler dispatch failed…
- Feign calls cannot use “_” to report errors [How to Solve]
- Frequent log swiping after Nacos client starts [How to Solve]