SpringBoot升级2.4.0所出现的问题:When allowCredentials is true, allowedOrigins cannot contain the specia
- 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.
翻译如下:
解决办法:跨域配置报错,将.allowedOrigins
替换成.allowedOriginPatterns
即可。
修改前:
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {/*** 开启跨域*/@Overridepublic void addCorsMappings(CorsRegistry registry) {// 设置允许跨域的路由registry.addMapping("/**")// 设置允许跨域请求的域名.allowedOrigins("*")// 是否允许证书(cookies).allowCredentials(true)// 设置允许的方法.allowedMethods("*")// 跨域允许时间.maxAge(3600);}}
修改后:
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {/*** 开启跨域*/@Overridepublic void addCorsMappings(CorsRegistry registry) {// 设置允许跨域的路由registry.addMapping("/**")// 设置允许跨域请求的域名.allowedOriginPatterns("*")// 是否允许证书(cookies).allowCredentials(true)// 设置允许的方法.allowedMethods("*")// 跨域允许时间.maxAge(3600);}}
SpringBoot升级2.4.0所出现的问题:When allowCredentials is true, allowedOrigins cannot contain the specia相关推荐
- Springboot跨域配置报错:When allowCredentials is true, allowedOrigins cannot contain the specia
错误信息为: When allowCredentials is true, allowedOrigins cannot contain thespecial value "*"si ...
- 【SpringBoot】升级2.4.0所出现的问题:When allowCredentials is true, allowedOrigins cannot contain the specia
项目场景: 提示:这里简述项目相关背景: 保留现场: When allowCredentials is true, allowedOrigins cannot contain the special ...
- SpringBoot升级所出现的问题:When allowCredentials is true, allowedOrigins cannot contain the specia
错误信息如下 When allowCredentials is true, allowedOrigins cannot contain the special value "*" ...
- SpringBoot升级到2.0后默认时间格式变化_springboot接收date类型参数
springboot1.x时,请求返回默认将Date类型转换成时间戳: createTime: 1544693261000 然而在升级到springboot2.0后,默认返回的时间格式变成了UTC字符 ...
- Spring Boot 从1.0 升级到 2.0 所踩的坑
先给大家晒一下云收藏的几个数据,作为一个 Spring Boot 的开源项目(https://github.com/cloudfavorites/favorites-web)目前在 Github 上面 ...
- 从.NET1.1升级到.NET2.0时出现的PInvokeStackImbalance错误
从.NET1.1升级到.NET2.0时出现的PInvokeStackImbalance错误 微软官方的解释(http://msdn2.microsoft.com/zh-cn/library/0htdy ...
- 7 环境变量 立即生效_MySQL5.7升级到8.0过程详解
前言: 不知不觉,MySQL8.0已经有好多个GA小版本了.目前互联网上也有很多关于MySQL8.0的内容了,MySQL8.0版本基本已到稳定期,相信很多小伙伴已经在接触8.0了.本篇文章主要介绍从5 ...
- mysql 5.6 uf8mb4_MySQL5.7升级到8.0过程详解
前言: 不知不觉,MySQL8.0已经发布好多个GA小版本了.目前互联网上也有很多关于MySQL8.0的内容了,MySQL8.0版本基本已到稳定期,相信很多小伙伴已经在接触8.0了.本篇文章主要介绍从 ...
- 坚果 android 系统升级,坚果手机的系统是什么?坚果手机能升级安卓5.0吗?
坚果手机的手机系统是什么 坚果手机的手机系统是Android 4.4系统. 系统方面,坚果手机采用与锤子T1相同的Smartisan OS 1.5,基于Android 4.4.4深度定制的系统表现很出 ...
最新文章
- 20165237 2017-2018-2 《Java程序设计》第5周学习总结
- 好好学python · 你真的会列表吗(列表推导式质检员)
- Qt中多线程间的互斥
- Cookie的小知识
- suface怎么把计算机放到桌面,快速使用Surface的八条技巧
- C#基础知识1-深入理解值类型和引用类型
- python库管理_Python中管理数据库
- RANDOM模块:PYTHON获取随机数
- 如何在 M1 Mac 上运行英特尔应用程序?
- 【VS2010学习笔记】【编程实例】 (含有类的动态链接库的封装和调用)
- 2021-08-3126. 删除有序数组中的重复项 数组
- centos7修改mysql默认端口号_修改mysql默认端口方法(linux centos 7)
- html app5 仿微信朋友圈,uniapp仿微信聊天App界面|仿微信朋友圈|uniapp仿微信
- 战地1服务器怎么显示fps,战地1怎么显示FPS帧数-战地1显示FPS帧数方法介绍
- 业务部门战略规划与支撑部门战略规划
- 汇编语言 程序设计 分支结构
- linux桌面应用小结,Linux桌面应用技巧大全
- 某医药公司HP-EVA4400数据恢复报告
- querylist V4 图片下载
- 同网段能互通,跨网段不通
热门文章
- 20th Century Fox — 利用机器学习来预测电影观众
- 输入框input type=“text“(获取值、设置默认值)
- NLP基本功-文本相似度 | AI产品经理需要了解的AI技术通识
- Prometheus和Grafana告警服务创建与对接腾讯云短信告警平台(prometheus_alert)
- 阿里云和腾讯云免费SSL证书 专题
- WMS仓储系统值得提高的功能点
- 实习html周日志,实习日志:最后的一周
- 树--先序遍历构建二叉树
- 寻找苦难旷野中的卡兹拉(tab键看地图)
- PHP内核源码阅读过程(四)