admin管理员组文章数量:1026989
在spring5.3之后,使用
corsConfiguration.addAllowedOrigin("*");
会抛出异常
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.
引起在5.3之后,引入了
corsConfiguration.addAllowedOriginPattern("*")
所以请替换使用
在spring5.3之后,使用
corsConfiguration.addAllowedOrigin("*");
会抛出异常
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.
引起在5.3之后,引入了
corsConfiguration.addAllowedOriginPattern("*")
所以请替换使用
本文标签: originssetcredentialsallowedOriginPatteexplicitly
版权声明:本文标题:To allow credentials to a set of origins, list them explicitly or consider using “allowedOriginPatte 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/jiaocheng/1738333008a1562168.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论