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.
时间: 2023-09-28 10:13:03 浏览: 238
这句话是什么意思?
这句话是关于跨域资源共享(CORS)的。当设置 allowCredentials 为 true 时,表示允许请求携带凭证信息,例如 cookie 等。但是,如果 allowedOrigins 中包含了通配符 "*",则无法设置响应头中的 "Access-Control-Allow-Origin" 为 "* ",因为这是不允许的。此时,需要明确列出允许的 origin,或者考虑使用 allowedOriginPatterns。allowedOriginPatterns 允许使用正则表达式来匹配多个允许的 origin。
相关问题
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 expli
citly or consider using "allowedoriginpatterns" instead.
这是一个Java异常,意思是当设置allowcredentials为true时,allowedorigins不能包含特殊值“*”,因为这个值不能被设置在“access-control-allow-origin”响应头中。如果要允许一组来源的凭据,需要明确列出它们,或者考虑使用“allowedoriginpatterns”代替。
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 "allowedori
当allowcredentials为true时,allowedorigins不能包含特殊值"*",因为该值无法在"access-control-allow-origin"响应头中设置。要允许特定的来源访问凭据,需要明确列出这些来源,或者考虑使用"allowedori"来设置。
阅读全文