前言
報錯:
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.
原因:springboot升級2.6.0后所出現(xiàn)的問題
解決方法:將.allowedOrigins 替換成. allowedOriginPatterns 即可。
如下圖:
ps:這是2.3時代的配置,現(xiàn)在不叫這個了,要用:文章來源:http://www.zghlxwxcb.cn/news/detail-834723.html
文章來源地址http://www.zghlxwxcb.cn/news/detail-834723.html
到了這里,關于springcloud-gateway升級版本allowedOrigins要改allowedOriginPatterns的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!