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 "*"的更多相关文章

  1. HDU 4569 Special equations(取模)

    Special equations Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u S ...

  2. (转载)phpcms v9两步实现专题栏目生成路径去掉html和special

    相信很多人都知道,phpcms v9专题是不支持自定义URL的,生成的专题路径是以/HTML/special/开头的.那么如何实现专题栏目生成路径去掉html和special呢?通过修改程序的PHP源 ...

  3. QIBO CMS SQL Injection Via Variable Uninitialization In \member\special.php

    Catalog . 漏洞描述 . 漏洞触发条件 . 漏洞影响范围 . 漏洞代码分析 . 防御方法 . 攻防思考 1. 漏洞描述 该漏洞存在于/member/special.php文件下,由于未对变量进 ...

  4. 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 || ...

  5. poj-3739. Special Squares(二维前缀和)

    题目链接: I. Special Squares There are some points and lines parellel to x-axis or y-axis on the plane. ...

  6. 【教程】如何正确的写一个Lemon/Cena的SPJ(special judge)

    转自:http://www.cnblogs.com/chouti/p/5752819.html Special Judge:当正确的输出结果不唯一的时候需要的自定义校验器 首先有个框架 #includ ...

  7. CodeForces 219B Special Offer! Super Price 999 Bourles!

    Special Offer! Super Price 999 Bourles! Time Limit:1000MS     Memory Limit:262144KB     64bit IO For ...

  8. Codeforces Round #249 (Div. 2) D. Special Grid 枚举

    题目链接: http://codeforces.com/contest/435/problem/D D. Special Grid time limit per test:4 secondsmemor ...

  9. 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 ...

  10. 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 ...

随机推荐

  1. 龙芯发布 .NET 8 SDK 8.0.100-rc2 LoongArch64

    随着.NET 8的发布的临近,国内的社区朋友们也很关心龙芯.NET 团队对于Loongarch .NET 8的发布时间,目前从龙芯.NET编译器团队的可靠信息,Loongarch .NET 8的发布会 ...

  2. PTA作业4、5、6及期中考试的总结

    一.前言 本次博客是针对面向对象程序设计课程布置的PTA第4.5.6次作业以及期中考试的编程题而写的总结分析,重点分析了菜单计价系列题目.期中考试的编程题等具有一定难度和特色的问题. 二.PTA第四次 ...

  3. 详细一些的vue生命周期

    如果你和我一样,以前对vue生命周期的理解仅限于生命周期钩子,那么本文可以让我们更深入一层,理解vue在生命周期各个阶段所做的事,对我们对vue的理解和使用很有好处. (1)通过new Vue()创建 ...

  4. [CF1788F] XOR, Tree, and Queries

    题目描述 You are given a tree of $ n $ vertices. The vertices are numbered from $ 1 $ to $ n $ . You wil ...

  5. .NET周刊【12月第2期 2023-12-13】

    国内文章 用最清爽的方式开发dotNet https://www.cnblogs.com/ncellit/p/17881779.html 本文介绍了如何以清爽的方式开发dotNet应用,特别是简单的A ...

  6. bash shell笔记整理——外部命令和内部命令区别

    linux命令的类别: 外部命令 内部命令 什么是内部命令 bash shell程序内部自带的命令. 什么是外部命令 不是bash shell内建命令,bash会根据用户给定的命令从PATH环境变量中 ...

  7. 华企盾DSC编辑文件不加密常见问题

    1.先查看客户端日志主进程是否是加密进程.日志中是不是勾选智能半透明.加密类型是否有添加 2.用procmon监控保存的文件找出writefile的进程是否有添加,进程树是否有父进程,加密类型是否正确 ...

  8. 如何保障Cookie的信息安全

    一.支持策略 保障 Cookie 的安全性可以从以下几个方面进行: 使用 HttpOnly 属性:设置 HttpOnly 属性可以防止JavaScript Document.cookie API 无法 ...

  9. 从零玩转前后端加解密之SM2-sm2

    title: 从零玩转前后端加解密之SM2 date: 2022-08-21 19:42:00.907 updated: 2023-03-30 13:28:48.866 url: https://ww ...

  10. Ubuntu 安装MySQL 8.0.23及以上版本

    首先如果当前linux中没有wget,那么我们可以考虑使用sudo apt-get install wget来安装wget命令 Ubuntu自带的源只能安装MySQL5.7版本,这里去MySQL官网安 ...