allowedOrigins cannot contain the special value "*" gateway

created at 07-10-2021 views: 555


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(

Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:

Error has been observed at the following site(s):

|_ checkpoint ⇢ [DefaultWebFilterChain][from]

The cause of the problem, the new version of the gateway canceled allowedOrigins, and the corresponding change was allowedOriginPatterns


The configuration is modified to:

#Use service discovery route
#Service route name lowercase
#Cross-domain configuration (java[/**].allowedOriginPatterns=*[/**].allowedHeaders=*[/**].allowedMethods=*[/**].allowCredentials=true
created at:07-10-2021
edited at: 07-10-2021: