我收到一个无法修复的错误。我正在从 Google Cloud Storage 发送一个 CORS 资源的获取,但是当我在没有范围请求的情况下发送时,它可以工作。但是如果我添加范围请求,它会失败。会出什么问题?
fetch("https://storage.googleapis.com/bucket/abc.pdf", {
"headers": {
"range": "bytes=24772608-24832146"
},
"referrer": "http://localhost:8000/",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": null,
"method": "GET",
"mode": "cors",
"credentials": "omit"
});
请注意导致问题的标题范围。
这是我的 Google Storage CORS 配置:
[{"origin": ["*"],"responseHeader": ["Content-Type", "Accept-Ranges", "Content-Range", "Content-Encoding", "Content-Length","Access-Control-Allow-Origin"],"method": ["GET", "HEAD", "OPTIONS"],"maxAgeSeconds": 3600}]
Google Cloud Storage 支持范围请求,但不清楚如何配置它。