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 ...
随机推荐
- CAP 定理的含义(转)
分布式系统(distributed system)正变得越来越重要,大型网站几乎都是分布式的. 分布式系统的最大难点,就是各个节点的状态如何同步.CAP 定理是这方面的基本定理,也是理解分布式系统的起 ...
- Hundred Finance 攻击事件分析
Hundred Finance 背景知识 Hundred Finance 是 fork Compound 的一个借贷项目,在2023/04/15遭受了黑客攻击.攻击者在发起攻击交易之前执行了两笔准备交 ...
- 使用C#将几个Excel文件合并去重分类
需要将几个Excel表格里面的数据去重,然后将每个站点的数据另存为一张Sheet上. 几个表格如下所示: 实现效果如下所示: 具体实现 需要使用EPPlus操作Excel 安装EPPlus如下所示: ...
- JavaWeb项目中web.xml配置文件<servlet-class>…</servlet-class>中的路径出现问题以及服务器错误的解决办法
问题如图 原因: 1.改变了 WEB-INF 文件夹下 lib 文件夹下 servlet-api.jar 的路径2.缺失lib文件夹下的 servlet-api.jar,没有添加到库中 解决办法: 不 ...
- 小程序的登录授权与退出功能(wx.getUserProfile)
一.授权登录:wx.getUserProfile 1.使用wx.getUserProfile实现登录 1.javascript: login(){ wx.getUserProfile({ desc: ...
- 记一次逆向分析解密还原Class文件
前言 前阵子我的一位朋友发来一份代码让我帮忙看看.具体就是所有的jsp文件内容和大小都一样,漏洞挖掘无从下手.经过分析发现所有的Class都使用了自定义的加密工具加密,经过逆向分析,顺利解密,因而有了 ...
- VCS用法
1.时钟频率点击,鼠标左键点击波形上升沿,中间滚轮点击,然后选择hz,就显示当前信号时钟频率. 2.窗口乱掉,找不到文件列表,右下角点击弹出选择instance. 3.bus地址查找,选择信号,然后蓝 ...
- MongoDB中的分布式集群架构
MongoDB 中的分布式集群架构 前言 Replica Set 副本集模式 副本集写和读的特性 Sharding 分片模式 分片的优势 MongoDB 分片的组件 分片键 chunk 是什么 分片的 ...
- 封装Detours用于Python中x64函数hook
Detours 代码仓库: https://github.com/microsoft/Detours x64写一个任意地址hook要比x86麻烦的多,所以这里直接封装框架来用于x64的hook. De ...
- 【Python微信机器人】第六七篇: 封装32位和64位Python hook框架实战打印微信日志
目录修整 目前的系列目录(后面会根据实际情况变动): 在windows11上编译python 将python注入到其他进程并运行 注入Python并使用ctypes主动调用进程内的函数和读取内存结构体 ...