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

边栏推荐
- 网络设备硬核技术内幕 路由器篇 (10) CISCO ASR9900拆解 (四)
- Stm32f103c8t6 drives ssd1306 0.96 "IIC OLED display under Arduino frame
- Txt replace line breaks with spaces or cancel line breaks
- 泛型
- 分布式锁
- lc marathon 7.26
- 华云数据打造完善的信创人才培养体系 助力信创产业高质量发展
- 多表查询_子查询概述和多表查询_子查询情况1&情况2&情况3
- STM32 can communication filter setting problem
- 移动端使用vantUI的list组件,多个tab项来回切换时,列表加载多次导致数据无法正常展示
猜你喜欢

Digital storage oscilloscope based on FIFO idt7202-12

RS485接口的EMC设计方案

TL431-2.5v基准电压芯片几种基本用法

工具 - markdown编辑器常用方法

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

USB2.0接口的EMC设计方案

基于stm32的数字示波器设计方案

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

适配验证新职业来了!华云数据参与国家《信息系统适配验证师国家职业技能标准》编制

Skywalking distributed system application performance monitoring tool - medium
随机推荐
Unity性能优化------渲染优化(GPU)之LOD(Level of detail)
reflex
关于印发《深圳市工业和信息化局绿色制造试点示范管理暂行办法》的通知
Unity性能优化------渲染优化(GPU)之Occlusion culling(遮挡剔除)
数据仓库项目从来不是技术项目
Data warehouse project is never a technical project
LeetCode 456. 132模式 单调栈/medium
网络设备硬核技术内幕 路由器篇 CISCO ASR9900拆解 (一)
Zhou Hongyi: if the digital security ability is backward, it will also be beaten
Understand the evolution of redis architecture in one article
An example of building 3D effects on the web based on three.js
USB接口电磁兼容(EMC)解决方案
2022-07-27日报:IJCAI 2022杰出论文公布,大陆作者中稿298篇拿下两项第一
Finally, someone finished all the dynamic planning, linked list, binary tree and string required for the interview
If we were the developer responsible for repairing the collapse of station B that night
adb命令 (安装apk包格式:adb install 电脑上apk地址包名)
网络设备硬核技术内幕 路由器篇 19 DPDK(四)
网络设备硬核技术内幕 路由器篇 9 CISCO ASR9900拆解 (二)
SkyWalking分布式系统应用程序性能监控工具-中
What is the breakthrough point of digital transformation in the electronic manufacturing industry? Lean manufacturing is the key