springcloud-gateway升级版本allowedOrigins要改allowedOriginPatterns

前言

报错:

powershell 复制代码
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.

原因:springboot升级2.6.0后所出现的问题

解决方法:将.allowedOrigins 替换成. allowedOriginPatterns 即可。

如下图:

ps:这是2.3时代的配置,现在不叫这个了,要用:

相关推荐
SimonKing4 小时前
开源文档解析天花板 MinerU 4.0:PDF / 图片 / Office 等任意文档都支持
java·后端·程序员
咖啡八杯4 小时前
Spring MessageSource 国际化消息解析流程
java·后端·spring·架构·框架·若依
博.闻广见5 小时前
第10篇:Agent系统的性能优化 —— 缓存、压缩与动态模型路由
java·人工智能·后端·spring·agent
Irene19915 小时前
Flink 学习日志 01:前端转大数据的实战避坑指南
java·jvm·flink
Thomas.Sir5 小时前
第1课:SpringBoot 4.x 快速上手:新特性、环境准备与第一个HelloWorld程序
java·spring boot
Raas1005 小时前
2026年AI网关推荐?MAI Gateway(魔芋企业级AI网关)等主流方案横评
大数据·人工智能·ai·gateway·ai网关·mai gateway
devilnumber5 小时前
Java 内部迭代 vs 外部迭代:从原理到实战避坑
java·开发语言
杨运交5 小时前
080-缓存模块-Spring Cache缓存键前缀设计与租户隔离实践
java·spring·缓存
\光辉岁月/5 小时前
5.math类
java·开发语言
文丑颜不良啊5 小时前
LeetCode76~100题目解析
java·leetcode