1. 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相关推荐

  1. Springboot跨域配置报错:When allowCredentials is true, allowedOrigins cannot contain the specia

    错误信息为: When allowCredentials is true, allowedOrigins cannot contain thespecial value "*"si ...

  2. 【SpringBoot】升级2.4.0所出现的问题:When allowCredentials is true, allowedOrigins cannot contain the specia

    项目场景: 提示:这里简述项目相关背景: 保留现场: When allowCredentials is true, allowedOrigins cannot contain the special ...

  3. SpringBoot升级所出现的问题:When allowCredentials is true, allowedOrigins cannot contain the specia

    错误信息如下 When allowCredentials is true, allowedOrigins cannot contain the special value "*" ...

  4. SpringBoot升级到2.0后默认时间格式变化_springboot接收date类型参数

    springboot1.x时,请求返回默认将Date类型转换成时间戳: createTime: 1544693261000 然而在升级到springboot2.0后,默认返回的时间格式变成了UTC字符 ...

  5. Spring Boot 从1.0 升级到 2.0 所踩的坑

    先给大家晒一下云收藏的几个数据,作为一个 Spring Boot 的开源项目(https://github.com/cloudfavorites/favorites-web)目前在 Github 上面 ...

  6. 从.NET1.1升级到.NET2.0时出现的PInvokeStackImbalance错误

    从.NET1.1升级到.NET2.0时出现的PInvokeStackImbalance错误 微软官方的解释(http://msdn2.microsoft.com/zh-cn/library/0htdy ...

  7. 7 环境变量 立即生效_MySQL5.7升级到8.0过程详解

    前言: 不知不觉,MySQL8.0已经有好多个GA小版本了.目前互联网上也有很多关于MySQL8.0的内容了,MySQL8.0版本基本已到稳定期,相信很多小伙伴已经在接触8.0了.本篇文章主要介绍从5 ...

  8. mysql 5.6 uf8mb4_MySQL5.7升级到8.0过程详解

    前言: 不知不觉,MySQL8.0已经发布好多个GA小版本了.目前互联网上也有很多关于MySQL8.0的内容了,MySQL8.0版本基本已到稳定期,相信很多小伙伴已经在接触8.0了.本篇文章主要介绍从 ...

  9. 坚果 android 系统升级,坚果手机的系统是什么?坚果手机能升级安卓5.0吗?

    坚果手机的手机系统是什么 坚果手机的手机系统是Android 4.4系统. 系统方面,坚果手机采用与锤子T1相同的Smartisan OS 1.5,基于Android 4.4.4深度定制的系统表现很出 ...

最新文章

  1. 20165237 2017-2018-2 《Java程序设计》第5周学习总结
  2. 好好学python · 你真的会列表吗(列表推导式质检员)
  3. Qt中多线程间的互斥
  4. Cookie的小知识
  5. suface怎么把计算机放到桌面,快速使用Surface的八条技巧
  6. C#基础知识1-深入理解值类型和引用类型
  7. python库管理_Python中管理数据库
  8. RANDOM模块:PYTHON获取随机数
  9. 如何在 M1 Mac 上运行英特尔应用程序?
  10. 【VS2010学习笔记】【编程实例】 (含有类的动态链接库的封装和调用)
  11. 2021-08-3126. 删除有序数组中的重复项 数组
  12. centos7修改mysql默认端口号_修改mysql默认端口方法(linux centos 7)
  13. html app5 仿微信朋友圈,uniapp仿微信聊天App界面|仿微信朋友圈|uniapp仿微信
  14. 战地1服务器怎么显示fps,战地1怎么显示FPS帧数-战地1显示FPS帧数方法介绍
  15. 业务部门战略规划与支撑部门战略规划
  16. 汇编语言 程序设计 分支结构
  17. linux桌面应用小结,Linux桌面应用技巧大全
  18. 某医药公司HP-EVA4400数据恢复报告
  19. querylist V4 图片下载
  20. 同网段能互通,跨网段不通

热门文章

  1. 20th Century Fox — 利用机器学习来预测电影观众
  2. 输入框input type=“text“(获取值、设置默认值)
  3. NLP基本功-文本相似度 | AI产品经理需要了解的AI技术通识
  4. Prometheus和Grafana告警服务创建与对接腾讯云短信告警平台(prometheus_alert)
  5. 阿里云和腾讯云免费SSL证书 专题
  6. WMS仓储系统值得提高的功能点
  7. 实习html周日志,实习日志:最后的一周
  8. 树--先序遍历构建二叉树
  9. 寻找苦难旷野中的卡兹拉(tab键看地图)
  10. PHP内核源码阅读过程(四)