当前位置:网站首页>谷粒商城配置CorsWebFilter后,报错:Resource sharing error:MultipleAllowOriginValues
谷粒商城配置CorsWebFilter后,报错:Resource sharing error:MultipleAllowOriginValues
2022-07-27 14:18:00 【Honyelchak】
谷粒商城项目在gateway中配置了CorsWebFilter来解决跨域问题:
@Bean
public CorsWebFilter corsWebFilter(){
UrlBasedCorsConfigurationSource configurationSource = new UrlBasedCorsConfigurationSource();
CorsConfiguration corsConfiguration = new CorsConfiguration();
//1. 配置跨域
corsConfiguration.addAllowedHeader("*");
corsConfiguration.addAllowedMethod("*");
corsConfiguration.addAllowedOrigin("*");
corsConfiguration.setAllowCredentials(true);
configurationSource.registerCorsConfiguration("/**", corsConfiguration);
return new CorsWebFilter(configurationSource);
}
但是重启项目之后,仍然报错:
Resource sharing error:MultipleAllowOriginValues
意思大概就是有多个AllowOriginValue值。
通过上图也能发现的确有多个相同的key-value。
这意味着不止在一处配置了跨域设置,gateway里边配置了一个,那只能去检查renren-fast项目中是否配置了跨域。
renren-fast中果然有跨域的配置:将其注释掉即可。

边栏推荐
- Data warehouse project is never a technical project
- 微信小程序实现音乐搜索页面
- [ManageEngine] what is Siem
- 两阶段提交与三阶段提交
- STM32F103C8T6在Arduino框架下驱动ssd1306 0.96“ IIC OLED显示
- 《剑指Offer》 链表反转
- Nokia's patent business was hit for the first time, and Chinese enterprises are not so easy to knead
- 华云数据打造完善的信创人才培养体系 助力信创产业高质量发展
- If we were the developer responsible for repairing the collapse of station B that night
- LeetCode 783. 二叉搜索树节点最小距离 树/easy
猜你喜欢

LeetCode 781. 森林中的兔子 哈希表/数学问题 medium

Dialog manager Chapter 3: create controls

Unity 鼠标控制第一人称摄像机视角

Skywalking distributed system application performance monitoring tool - medium

LeetCode 面试题 17.21. 直方图的水量 双指针,单调栈/hard

How to do well in enterprise system vulnerability assessment

工具 - markdown编辑器常用方法

See "sense of security" in uncertainty Volvo asked in 2022

Getting started with DirectX

Nokia's patent business was hit for the first time, and Chinese enterprises are not so easy to knead
随机推荐
[Yunxiang book club issue 13] packaging format of video files
Notice of Nanshan District Civil Affairs Bureau on carrying out the grade evaluation of social organizations in Nanshan District in 2022
USB2.0接口的EMC设计方案
LeetCode 190. 颠倒二进制位 位运算/easy
南山区民政局关于开展2022年度南山区社会组织等级评估工作的通知
HDU3117 Fibonacci Numbers【数学】
Basic usage of kotlin
网络设备硬核技术内幕 路由器篇 13 从鹿由器到路由器(上)
被动收入:回归原始且安全的两种赚取方法
Skywalking distributed system application performance monitoring tool - medium
网络设备硬核技术内幕 路由器篇 (10) CISCO ASR9900拆解 (四)
Unity performance optimization ----- LOD (level of detail) of rendering optimization (GPU)
NEFU118 n! How many zeros are there after [basic theorem of arithmetic]
微信小程序实现音乐搜索页面
lc marathon 7.26
电子制造行业的数字化转型突破点在哪?精益制造是关键
Code coverage statistical artifact -jacobo tool practice
Unity性能优化------DrawCall
【云享读书会第13期】多媒体处理工具 FFmpeg 工具集
Lesson 3: SPFA seeking the shortest path