当前位置:网站首页>谷粒商城配置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中果然有跨域的配置:将其注释掉即可。

边栏推荐
- Unity3D学习笔记10——纹理数组
- MOS管防止电源反接的原理
- Is it safe for Guosen Securities to open a mobile account? Is Zhongshan securities reliable
- 谷歌团队推出新Transformer,优化全景分割方案|CVPR 2022
- Code coverage statistical artifact -jacobo tool practice
- What is the breakthrough point of digital transformation in the electronic manufacturing industry? Lean manufacturing is the key
- 网络设备硬核技术内幕 路由器篇 15 从鹿由器到路由器 (下)
- 资本频频加码,急于上市的和府捞面有多“疯狂”?
- USB接口电磁兼容(EMC)解决方案
- 关于 CMS 垃圾回收器,你真的懂了吗?
猜你喜欢

LeetCode 74. 搜索二维矩阵 二分/medium

The mobile terminal uses the list component of vantui. When multiple tab items are switched back and forth, the list is loaded many times, resulting in the failure of normal display of data

Basic usage of kotlin

移动端使用vantUI的list组件,多个tab项来回切换时,列表加载多次导致数据无法正常展示

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

Understand the evolution of redis architecture in one article

Visual system design example (Halcon WinForm) -10. PLC communication

基于FIFO IDT7202-12的数字存储示波器

LeetCode 240. 搜索二维矩阵 II medium

Digital storage oscilloscope based on FIFO idt7202-12
随机推荐
《剑指Offer》 合并两个排序的链表
What is the breakthrough point of digital transformation in the electronic manufacturing industry? Lean manufacturing is the key
lc marathon 7.26
Digital storage oscilloscope based on FIFO idt7202-12
NEFU118 n! How many zeros are there after [basic theorem of arithmetic]
南山区民政局关于开展2022年度南山区社会组织等级评估工作的通知
Hdu3117 Fibonacci numbers [mathematics]
工具 - markdown编辑器常用方法
Do you really understand CMS garbage collector?
【云享读书会第13期】多媒体处理工具 FFmpeg 工具集
What is tor? What is the use of tor browser update?
Notice of Nanshan District Civil Affairs Bureau on carrying out the grade evaluation of social organizations in Nanshan District in 2022
修改frameworks资源文件如何单编
Graphical SQL is too vivid
Zhou Hongyi: if the digital security ability is backward, it will also be beaten
NEFU117 素数个数的位数【素数定理】
internship:其他配置类的编写
STM32 CAN 通信 滤波设置问题
Stm32f103c8t6 drives ssd1306 0.96 "IIC OLED display under Arduino frame
Idea makes jar packages and introduces jar packages