2021年6月7日星期一

gateway 报错 allowedOrigins cannot contain the special value "*"

 
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.org]

问题原因,新版本的gateway 取消了allowedOrigins, 对应的变更为 allowedOriginPatterns

配置修改为:

#--------gateway配置--------#使用服务发现路由spring.cloud.gateway.discovery.locator.enabled=true#服务路由名小写spring.cloud.gateway.discovery.locator.lower-case-service-id=true#跨域配置(java www.fhadmin.org)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

 一:springcloud服务 -----------------------

java www.fhadmin.org

------------------------------------------
1.nacos 阿里注册中心:官方eureka停止更新,目前比较好的取代者就是nacos
2.zipkin 跟踪服务:分布式跟踪日志,基于内存存储记录
3.gateway 网关路由服务:分发请求,统一管理过滤,结合 ribbon 负载均衡、feign服务调用
4.springboot-admin 监控中心服务:统一界面管理,查看各个服务运行状态 actuator健康检查
5.sentinel 高可用流量管理框架:以流量为切入点,限流、流量整形、熔断降级、系统负载保护、热点防护









原文转载:http://www.shaoqun.com/a/790313.html

跨境电商:https://www.ikjzd.com/

邮乐网购:https://www.ikjzd.com/w/1776

知无不言:https://www.ikjzd.com/w/1308

telegram:https://www.ikjzd.com/w/1734

深兰科技:https://www.ikjzd.com/w/1517


java.lang.IllegalArgumentException:WhenallowCredentialsistrue,allowedOriginscannotcontainthespecialvalue"*"sincethatcannotbesetonthe"Access-Control-Allow-Origin"responseheader.Toal
f2c:https://www.ikjzd.com/w/1242
灰色清关:https://www.ikjzd.com/w/1409
抢注商标:https://www.ikjzd.com/w/1053
淘粉吧返利:https://www.ikjzd.com/w/1725
杨帆:https://www.ikjzd.com/w/1648
老公和小蜜在办公室干柴烈火:http://lady.shaoqun.com/a/270676.html
电话那头的激情让我很崩溃:http://lady.shaoqun.com/a/272112.html
口述:未来嫂子竟是我的情人:http://www.30bags.com/a/254135.html
老公出差我和领导疯狂相爱 口述在自己家出轨上司很后悔:http://www.30bags.com/m/a/250133.html
我劈腿三次老公逼我讲嘿咻细节:http://www.30bags.com/m/a/251239.html
重要提醒:7月1日起亚马逊将核查德国站卖家地址:https://www.ikjzd.com/articles/145590
看看刘涛和凯莉,历史上最脏的一对:http://lady.shaoqun.com/a/360098.html
亚马逊如何开发产品,亚马逊产品开发流程:https://www.ikjzd.com/articles/145583

没有评论:

发表评论

跨境电商资讯:外贸宣传平台有哪些(出口的

现在很多做外贸的人都非常关注 外贸企业怎么推广 ,而现在推广的途径和平台有很多,企业如果都做,成本和时间精力是一个问题,而且并不是所有的推广渠道都是有用的。今天云程网络就来为大家盘点几个有效的外贸推广渠道。 一、海外社交媒体营销 Facebook,领英等海外社交媒体营销在近几年得...