当前位置:网站首页>网关gateway跨域
网关gateway跨域
2022-08-01 00:18:00 【聊Java】
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.reactive.CorsWebFilter;
import org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource;
@Configuration
public class MallCorsWebFilter {
@Bean
public CorsWebFilter corsWebFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration corsConfiguration = new CorsConfiguration();
corsConfiguration.addAllowedHeader("*");
corsConfiguration.addAllowedMethod("*");
corsConfiguration.addAllowedOrigin("*");
corsConfiguration.setAllowCredentials(true);
source.registerCorsConfiguration("/**", corsConfiguration);
return new CorsWebFilter(source);
}
}
边栏推荐
- LeetCode--The problem of robbery
- Automated machine learning pycaret: PyCaret Basic Auto Classification LightGBM
- 一文带你了解 Grafana 最新开源项目 Mimir 的前世今生
- zeno使用方法笔记
- C# Rectangle基本用法和图片切割
- Rainbow share | how to use moving targets defense technology to guard against the unknown
- 精心总结十三条建议,帮你创建更合适的MySQL索引
- 【1161. 最大层内元素和】
- Flutter教程之 01配置环境并运行demo程序 (教程含源码)
- 力扣二叉树
猜你喜欢
TFC CTF 2022 WEB Diamand WriteUp
Google Earth Engine——Error: Image.clipToBoundsAndScale, argument ‘input‘: Invalid type的错误解决
Handwritten a simple web server (B/S architecture)
Team of Professor Chen Jianyu of Tsinghua University | Contact Safety Reinforcement Learning Framework Based on Contact-rich Robot Operation
精心总结十三条建议,帮你创建更合适的MySQL索引
虹科分享|如何用移动目标防御技术防范未知因素
清华大学陈建宇教授团队 | 基于接触丰富机器人操作的接触安全强化学习框架
【Acwing】The 62nd Weekly Game Solution
[微服务]分布式事务解决方案-Seata
推荐系统:常用评价指标总结【准确率、精确率、召回率、命中率、(归一化折损累计增益)NDCG、平均倒数排名(MRR)、ROC曲线、AUC(ROC曲线下的面积)、P-R曲线、A/B测试】
随机推荐
lua入门案例实战1234定义函数与标准函数库功能
Web API 介绍和类型
2022年最新重庆建筑八大员(电气施工员)模拟题库及答案
Force buckle 2326, 197
字符编码和浮点型计算精度丢失问题
cobaltstrike
Difference Between Stateless and Stateful
thymeleaf iterates the map collection
Recommendation system: Summary of common evaluation indicators [accuracy rate, precision rate, recall rate, hit rate, (normalized depreciation cumulative gain) NDCG, mean reciprocal ranking (MRR), ROC
NIO programming
Unity3D学习笔记10——纹理数组
南方科技大学:Xiaoying Tang | AADG:视网膜图像分割领域泛化的自动增强
Matlab / Arcgis处理nc数据
When can I use PushGateway
Flink 1.13(八)CDC
简单的vim配置
对象缓存服务的思考和实现
编程语言是什么
Exam preparation plan
Flutter教程之 02 Flutter 桌面程序开发入门教程运行hello world (教程含源码)