当前位置:网站首页>Cross domain configuration error: when allowcredentials is true, allowedorigins cannot contain the special value "*“
Cross domain configuration error: when allowcredentials is true, allowedorigins cannot contain the special value "*“
2022-04-23 09:06:00 【Scattered quicksand】
problem : stay SpringBoot Configuring cross domain requests in a project , Visit... After starting the project swagger Page error reporting :

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.
Income from Baidu , This is a SpringBoot upgrade 2.4.0 Problems after , Blogger SpringBoot Version is 2.6.*, Sure enough, I didn't escape this spell .
Solution :
CrosConfig.class Original configuration :
According to the problem description :To allow credentials to a set of origins, list them explicitly or consider using "allowedOriginPatterns" instead, We can take allowedOrigins Change it to allowedOriginPatterns Give it a try , After modification CrosConfig.class The configuration is as follows :

Restart the project and access swagger page , The error is solved perfectly .

版权声明
本文为[Scattered quicksand]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230720296079.html
边栏推荐
- Get trustedinstaller permission
- LeetCode_DFS_中等_1254. 统计封闭岛屿的数目
- Valgrind et kcachegrind utilisent l'analyse d'exécution
- 单片机数码管秒表
- Concave hull acquisition method based on convex hull of point cloud
- MYCAT configuration
- valgrind和kcachegrind使用運行分析
- Trc20 fund collection solution based on thinkphp5 version
- 调包求得每个样本的k个邻居
- What is augmented reality technology? Where can it be used?
猜你喜欢

Write down the post order traversal of the ~ binary tree

机器学习(六)——贝叶斯分类器

资源打包关系依赖树

Valgrind and kcache grind use run analysis

搞不懂时间、时间戳、时区,快来看这篇

112. 路径总和

计算神经网络推理时间的正确方法
![[SQL Server fast track] view and cursor of database](/img/2c/8edd92ecef11932c982db56af76c3f.png)
[SQL Server fast track] view and cursor of database

Summary of solid problems
![[in-depth good article] detailed explanation of Flink SQL streaming batch integration technology (I)](/img/c9/43a63f526068ef6a3e4964a22c5a1f.png)
[in-depth good article] detailed explanation of Flink SQL streaming batch integration technology (I)
随机推荐
Talent Plan 学习营初体验:交流+坚持 开源协作课程学习的不二路径
Trc20 fund collection solution based on thinkphp5 version
Whether the same binary search tree (25 points)
Introduction to GUI programming swing
Cadence process angle simulation, Monte Carlo simulation, PSRR
MATLAB入门资料
npm报错 :operation not permitted, mkdir ‘C: \Program Files \node js \node_ cache _ cacache’
資源打包關系依賴樹
错题汇总1
Idea package jar file
Chris LATTNER, father of llvm: the golden age of compilers
Rembg split mask
Brush classic topics
Download and install bashdb
RSA 加密解密签名验签
Write down the post order traversal of the ~ binary tree
LLVM之父Chris Lattner:编译器的黄金时代
Flink reads MySQL and PgSQL at the same time, and the program will get stuck without logs
Wechat applet catchtap = "todetail" event problem
LeetCode_ DFS_ Medium_ 1254. Count the number of closed islands