Google Cloud CDN 设置了一个后端存储桶,该存储桶已配置并在通过
curl
调用时用于签名 cookie。
我在浏览器中正确设置了 Cloud-CDN-Cookie,但是在调用 CDN 时,请求标头不包含它(不存在 Cookie 标头)。
在浏览器中调用时,使用如下所示的 fetch:
fetch('https://<bucket-ip>/test/test.png', {
method: 'GET',
credentials: 'include',
})
浏览器返回以下错误:
从源“http://localhost:5173”获取“https:///test/test.png”的访问已被 CORS 策略阻止:“Access-Control-Allow-Credentials”标头的值响应为“”,当请求的凭据模式为“包含”时,该响应必须为“true”。
Google CDN 是否需要返回此“Access-Control-Allow-Credentials”标头才能正常工作?我无法在任何地方找到如何在 Google CDN 的响应中添加此标头。