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时代的配置,现在不叫这个了,要用:

相关推荐
特立独行的猫A12 小时前
cj-tauri:用仓颉写桌面与鸿蒙 PC 应用
java·后端·python
Lonely丶墨轩12 小时前
从一个 404 到负数 ID:第三方接口开发中的几次排错
java
聪明的笨猪猪12 小时前
实际工程问题:AI生成MyBatis批量操作的SQL超限与性能雪崩
java·经验分享·面试·ai编程
文丑颜不良啊12 小时前
LeetCode2501~2520题目解析
java·leetcode
瑞雪兆丰年兮13 小时前
JavaWeb-day07-MySQL(DQL&多表设计)
java·开发语言·数据库·sql·mysql·javaweb·web
唐老板13 小时前
Spring Boot 4 默认开虚拟线程,HikariCP 却成瓶颈
java
2601_962106641 天前
【Java Set综合实战】商品管理系统 + 图书收藏系统|Product、Book自定义类全套代码
java
RuoyiOffice1 天前
SpringBoot+Vue3 凭证生命周期设计:审核、过账、冲销与反过账怎样保持账目一致
java·spring boot·事务·springboot3·财务系统·会计凭证·ruoyi office
2601_962106641 天前
HashMap入门|工号-姓名键值存储、两种遍历方式、根据key/value查
java
杨凯凡1 天前
Spring Framework 7 API 版本管理实战:请求头路由、兼容迁移与废弃策略
java·rest api·springframework·spring boot 4·api版本管理