`
java开发者SSM
  • 浏览: 14466 次
文章分类
社区版块
存档分类
最新评论

gateway 报错 allowedOrigins cannot contain the special value "*"

 
阅读更多
 

 

java.lang.IllegalArgumentException: When allowCredentials is true, allowedOrigins cannot contain 
the special value "*" since that cannot be set on the "Access-Control-Allow-Origin" response 
header. To allow credentials to a set of origins, list them explicitly or consider using "allowedOriginPatterns" instead.
	at org.springframework.web.cors.CorsConfiguration.validateAllowCredentials(CorsConfiguration.java:460)

	Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
Error has been observed at the following site(s):
	|_ checkpoint ⇢ org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter [DefaultWebFilterChain][from www.fhadmin.org]

问题原因,新版本的gateway 取消了allowedOrigins, 对应的变更为 allowedOriginPatterns

配置修改为:

 

#--------gateway配置--------
#使用服务发现路由
spring.cloud.gateway.discovery.locator.enabled=true
#服务路由名小写
spring.cloud.gateway.discovery.locator.lower-case-service-id=true
#跨域配置(java www.fhadmin.org)
spring.cloud.gateway.globalcors.corsConfigurations.[/**].allowedOriginPatterns=*
spring.cloud.gateway.globalcors.corsConfigurations.[/**].allowedHeaders=*
spring.cloud.gateway.globalcors.corsConfigurations.[/**].allowedMethods=*
spring.cloud.gateway.globalcors.corsConfigurations.[/**].allowCredentials=true

 

分享到:
评论

相关推荐

    数据库复习资料

    ### 数据库复习资料知识点梳理 #### 第一章 数据库概述 1. **数据与信息的基本含义及相互关系**: - **数据**:是客观事物的符号表示,用于描述现实世界中的各种现象。 - **信息**:是对数据进行加工处理的结果...

    xcode报错SDK does not contain 'libarclite' at the path

    然而,开发者们时常会遇到各种各样的错误,其中“SDK does not contain 'libarclite' at the path”是一个常见的问题,主要与Apple的Automatic Reference Counting (ARC)机制有关。本文将深入探讨这个错误的原因、...

    SDK does not contain 'libarclite'

    标题中的问题"SDK does not contain 'libarclite'"指的是某个SDK缺少一个名为`libarclite`的库文件。这可能是一个错误或者是因为SDK未完整安装或配置不当导致的。 `libarclite`是一个特定的库,尤其在Android开发中...

    联想旭日420AXP系统芯片组驱动

    the '-S' flags MUST be specified at the end of the command line flag list. Flag Description ---- ----------- -? Displays the list of available command line flags. This flag works in Interactive ...

    python自动化RobotFramework中Collections字典关键字使用(五).docx

    9. **Dictionary Should Not Contain Value** - 功能:检查字典是否不包含指定的value。 - 用于验证字典中不存在某个值。 10. **Get Dictionary Items** - 功能:获取字典的所有key-value对,默认返回排序后的...

    VisualFoxPro6.0中文版命令手册.pdf

    `NOT NULL` indicates that the column cannot contain null values. **Add a Table to the Current Database:** ```plaintext ADD TABLE 表名 | ? ``` Adds an existing table to the current database. If `?` ...

    as_extensions_flash_lite_digital_home

    2. **Value and Object Types**: Defining custom value and object types that can be used within the extension. #### Coding an ActionScript Extension The coding process involves implementing the logic ...

    libarclite-arc,xcode, 解决 Xcode 14.3,Xcode 15 旧项目可能报错

    解决 Xcode 14.3,Xcode 15 旧项目可能报错 SDK does not contain 'libarclite' at the path '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphone...

    avs 标准文档中的源码

    the ParameterValue will overide the config file's settings. There must be whitespace between -f and -p commands and their respecitive parameters. 2.2 Decoder ldecod.exe decoder.cfg ...

    XCode 15.3 编译私有库 报错问题

    本文将深入探讨“XCode 15.3编译私有库报错问题”,特别是涉及到低版本中使用的.a静态库。 首先,让我们了解静态库(.a文件)。在iOS开发中,静态库是一种预编译的代码集合,它们在应用编译时会被直接链接到目标...

    CSharp 3.0 With the .NET Framework 3.5 Unleashed(english)

    Based on the provided information from the book "C# 3.0 With the .NET Framework 3.5 Unleashed," we can extract several key points and concepts that are essential for understanding the fundamentals of ...

    Jquery插件-通用基本函数

    * @Function contain(MAP) 判断MAP是否存在 * @Function get(key) 根据KEY查找value * @Function getValues(Keys) 获取多个values值 * @Function put(key,name) 添加MAP对象 * @Function putAll(MAP) 将MAP...

    libarclite-arc

    解决 Xcode 14.3,Xcode 15 旧项目可能报错 SDK does not contain 'libarclite' at the path '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphone...

    四六级:60组高分替换词组.pdf

    10. **拥有** - **contain**、**be equipped with** 和 **possess** 都表示拥有,但后两者强调装备和占有,更有力量。 11. **如果** - **in case of** 和 **in the event of** 用于假设情况,比直接用 **if** 更显...

    pdfbox最新版

    PDFBox是Apache软件基金会的一个开源项目,专门用于处理PDF(Portable Document Format)文档的Java库。这个最新的版本“pdfbox2.0.4”提供了全面的功能,帮助开发者在Java环境中创建、编辑、读取和操作PDF文件。...

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    Now it is possible to define is the drawing take place via WMPaint or via the PaintTo direct call (if rcPaint contain non-empty rectangle then WMPaint in progress). - FIX: The TFlexPanel.FPaintCache ...

    3D Path Planning and Stereo-based Obstacle Avoidance for Rotorcraft UAVs

    contain obstacles. D* Lite and Probabilistic Roadmaps are combined for path planning, together with stereo vision for obstacle detection and dynamic path updating. A 3D occupancy map is used to ...

    Android虚拟机Dalvik完整源码

    Some files contain code from both projects. In these cases, the header comment is a combination of the other two, and the portions of the code from Harmony are identified as indicated in the comment. ...

    ERROR ITMS-90062: “This bundle is invalid. The value for key CFBundleShortVersionString [1.2] …

    The value for key CFBundleShortVersionString [1.2] in the Info.plist file must contain a higher version than that of the previously approved version [1.15] 明明1.2的版本号要大于1.15,怎么还会出现错误...

Global site tag (gtag.js) - Google Analytics