当前位置:网站首页>Cross domain error: when allowcredentials is true, allowedorigins cannot contain the special value "*“
Cross domain error: when allowcredentials is true, allowedorigins cannot contain the special value "*“
2022-06-10 18:41:00 【nine point six】
The code I wrote at the beginning is like this :
@CrossOrigin(origins = "*",allowCredentials="true",allowedHeaders = "*",methods = {
})
Cross domain error reporting log
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource
[org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]:
Invocation of init method failed; nested exception is 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.

According to the prompt, I changed the code to this :
@CrossOrigin(originPatterns = "*",allowCredentials="true",allowedHeaders = "*",methods = {
})
And then it succeeded .
If it is a configuration class
The inside addAllowedOrigin Change to allowedOriginPatterns That's it
The resistance and long , Yes, it will be
边栏推荐
- 基础提升---树形DP补充
- TSMC liudeyin: do not worry about semiconductor inventory correction and cooperation between the United States, Japan and South Korea. This year's performance will increase by 30%!
- [kuangbin]专题十二 基础DP1
- TestNG的HelloWorld例子以及如何在命令行下运行
- 【ceph】ceph配置源码分析|common/config.*
- ADS,AXD基本使用说明
- AGI基础,不确定性推理,主观逻辑一书ppt1
- C语言在底层如何对double和float压栈
- 实时商业智能BI(二):合理的ETL架构设计实现准实时商业智能BI
- 商业智能BI的服务对象,企业管理者的管理“欲望”该如何实现?
猜你喜欢

The question of enterprise managers, where have we spent our money after so many years of informatization?

两部门发文明确校外培训机构消防安全条件

企业管理者的质疑,这么多年的信息化,我们的钱花哪去了?

The value of Business Intelligence BI. Is visual report equal to Business Intelligence BI?

AD18器件库导入简介

AOE network critical path

Domestic cosmetics, lost 618

自定义类型:结构体

Developers changing the world - Yao Guang teenagers playing Tetris

c语言---8 初识常见关键字
随机推荐
智慧城市网络安全建设框架及实践
Research on next generation distributed file system
微信小程序,获取当前页面,判断当前页面是不是tabbar页面
期货网上开户安全吗,具体怎么开户的
XML & XPath parsing
Wireshark学习笔记(二)取证分析案例详解
Metadata management, the basic construction of enterprises in the digital era
连续六年稳居中国SDN(软件)市场份额第一
ACL2022 | bert2BERT:参数复用的高效预训练方法,显著降低超大模型的训练成本
两部门发文明确校外培训机构消防安全条件
当前有哪些主流的全光技术方案?-下篇
LoRa模块无线收发通信技术详解
什么是商业智能BI,谈谈商业智能BI的定义与作用
Google Earth Engine(GEE)——哥白尼大气监测 (CAMS) 全球气溶胶AOI近实时观测数据集
(CVPR 2020) RandLA-Net: Efficient Semantic Segmentation of Large-Scale Point Clouds
【QNX Hypervisor 2.2 用户手册】3.2.3 ACPI表和FDT
AD18器件库导入简介
“双碳”背景下 数据中心规划设计的新趋势及展望
leecode27,977-双指针法
位运算题目