allowedOrigins cannot contain the special value "*"
Spring Boot的版本高于 2.4以后 ,原来的配置已经不适合目前的版本
将代码中的allowedOrigins改为allowedOriginPatterns
@Configuration
public class WebConfig implements WebMvcConfigurer {
/**
* 跨域支持
*
* @param registry
*/
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("*")
.allowedMethods("GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS")
.allowCredentials(true)
.maxAge(3600)
.allowedHeaders("*");
}
}
修改后
@Configuration
public class WebConfig implements WebMvcConfigurer {
/**
* 跨域支持
*
* @param registry
*/
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOriginPatterns("*")
.allowedMethods("GET","HEAD","POST","PUT","DELETE","OPTIONS")
.allowCredentials(true)
.maxAge(3600)
.allowedHeaders("*");
}
}
allowedOrigins cannot contain the special value "*"的更多相关文章
- HDU 4569 Special equations(取模)
Special equations Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u S ...
- (转载)phpcms v9两步实现专题栏目生成路径去掉html和special
相信很多人都知道,phpcms v9专题是不支持自定义URL的,生成的专题路径是以/HTML/special/开头的.那么如何实现专题栏目生成路径去掉html和special呢?通过修改程序的PHP源 ...
- QIBO CMS SQL Injection Via Variable Uninitialization In \member\special.php
Catalog . 漏洞描述 . 漏洞触发条件 . 漏洞影响范围 . 漏洞代码分析 . 防御方法 . 攻防思考 1. 漏洞描述 该漏洞存在于/member/special.php文件下,由于未对变量进 ...
- Jquery报错:Uncaught TypeError: ((m.event.special[e.origType] || (intermediate value)).handle || e.handler).apply is not a function
页面中出现了Jquery报错:Uncaught TypeError: ((m.event.special[e.origType] || (intermediate value)).handle || ...
- poj-3739. Special Squares(二维前缀和)
题目链接: I. Special Squares There are some points and lines parellel to x-axis or y-axis on the plane. ...
- 【教程】如何正确的写一个Lemon/Cena的SPJ(special judge)
转自:http://www.cnblogs.com/chouti/p/5752819.html Special Judge:当正确的输出结果不唯一的时候需要的自定义校验器 首先有个框架 #includ ...
- CodeForces 219B Special Offer! Super Price 999 Bourles!
Special Offer! Super Price 999 Bourles! Time Limit:1000MS Memory Limit:262144KB 64bit IO For ...
- Codeforces Round #249 (Div. 2) D. Special Grid 枚举
题目链接: http://codeforces.com/contest/435/problem/D D. Special Grid time limit per test:4 secondsmemor ...
- Project Euler 106:Special subset sums: meta-testing 特殊的子集和:元检验
Special subset sums: meta-testing Let S(A) represent the sum of elements in set A of size n. We shal ...
- Project Euler P105:Special subset sums: testing 特殊的子集和 检验
Special subset sums: testing Let S(A) represent the sum of elements in set A of size n. We shall cal ...
随机推荐
- Echarts图表基本参数设置说明
ECharts 是一款强大的数据可视化库,可以通过 JavaScript 构建交互式和动态的图表.在使用 ECharts 进行图表绘制时,我们可以通过设置各种参数来达到我们想要的效果.下面是对 ECh ...
- Go语言函数详解
函数 (1)函数的定义 函数使用func进行定义 函数是基本的代码块,用于执行一个任务 Go语言至少有一个main函数 函数声明告诉了编译器函数的名称,返回类型和参数 //1.无参数无返回值函数的定义 ...
- GKCTF2020WP-Crypto Misc
Crypto 小学生的密码学 题目 e(x)=11x+6(mod26) 密文:welcylk (flag为base64形式) 我的解答: 考点:仿射密码,已知a,b 结果base64加密即可 flag ...
- C++学习笔记九:值,常量,常表达式和常初始化
1. 值: Literal: Data that is directly represented in code without going through some other variable s ...
- 【问题解决】unable to do port forwarding: socat not found
问题复现 前阵子应公司要求做华为云平台的调研,写了一篇文档包含将华为云CCE下载kuberctl配置及使用kubectl转发流量到本地的操作. 今天一早上同事就发来一个错误界面,说是Java远程调试转 ...
- Tensorflow2.0:使用Keras自定义网络实战
tensorflow2.0建议使用tf.keras作为构建神经网络的高级API 接下来我就使用tensorflow实现VGG16去训练数据 背景介绍: 2012年 AlexNet 在 ImageNet ...
- Gradle导致Lombok不生效问题
现象 从debug看是可以查询到数据的,但是返回起前端是没有数据的 解决办法 // 引入lombok注解处理器 annotationProcessor,不然lombok不会生效 annotationP ...
- Celery将任务分发到不同的队列,交给不同的Worker处理
https://docs.celeryq.dev/en/stable/userguide/routing.html#routing-tasks https://blog.csdn.net/wangle ...
- 华企盾DSC手机app登录不上常见处理方法
1.DSC服务器是否正常运行. 2.telnet外网是否通.(需要在程序与功能中添加telnet功能才能在cmd窗口用telnet命令 举例:telnet 172.17.2.20 5558) 3.其它 ...
- SpringCloud OpenFeign的使用
SpringCloud OpenFeign的使用 是什么: 声明式http客户端. 目的: 使远程调用更简单 作用: 提供了http请求模板,仅需编写简单接口和插入注解,就可以定义好原始http请求的 ...