当前位置:网站首页>gateway gateway cross domain
gateway gateway cross domain
2022-08-01 01:08:00 【Talk about 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);
}
}
边栏推荐
- Carefully summarize thirteen suggestions to help you create more suitable MySQL indexes
- Web3.0: Building an NFT Market (1)
- RTL8762DK WDG (six)
- 力扣二叉树
- NIO programming
- Key Points Estimation and Point Instance
- An open source and easy-to-use flowchart drawing tool drawio
- Rasa 3.x Study Series - Rasa - Issues 4918 Study Notes
- Classes and Objects: Above
- GDB source code analysis series of articles five: dynamic library delay breakpoint implementation mechanism
猜你喜欢
随机推荐
北京突然宣布,元宇宙重大消息
Nmap 操作手册 - 完整版
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
MYSQL主从复制
Application of integrated stepper motor in UAV automatic airport
In 2022, the latest eight Chongqing construction members (electrical construction workers) simulation question bank and answers
MYSQL查询截取优化分析
七月集训(第31天) —— 状态压缩
RTL8762DK RTC (5)
Inheritance and friend, static member relationship
设计消息队列存储消息数据的MySQL表格
Likou Binary Tree
js 实现复制功能
Kyoto University: Masaki Waga | Dynamic Masking for Reinforcement Learning in Black Box Environments
The principle of virtual inheritance
Interview Question: Implementing Deadlocks
[MATLAB project combat] LDPC-BP channel coding
Rasa 3.x 学习系列- Rasa - Issues 4898 学习笔记
Web3.0:构建 NFT 市场(一)
C字符串数组反转