fetch(`https://multimedia-arg-such-transcript.trycloudflare.com/api/assistant?query=${encodeURIComponent(query)}`, {
method: 'GET',
credentials: "include",
})
return json(
{ response: processedResponse },
{
headers: {
"Set-Cookie": `threadID=${threadID}; Path=/; HttpOnly; Max-Age=86400;`,
"Access-Control-Allow-Origin": "https://getvoicecart.myshopify.com/",
"Access-Control-Allow-Credentials": "true",
"Access-Control-Allow-Methods": "GET, POST, OPTIONS",
"Access-Control-Allow-Headers": "Content-Type, Authorization, _shopify_y",
},
}
);
Https://getvoicecart.myshopify.com)。
确认可以到达Cloudflare服务器。
我希望如果有人有同样的问题,他们会遇到我的解决方案,而不会浪费相同的时间,事实证明这要简单得多 - 由于Cloudflare Cors设置,该策略被覆盖了,您无法进行cookie转移.