fs3088 和你遇到了一样的问题,我的endpoint是https://s3.us-west-004.backblazeb2.com/
地区写的us-west-004, CORS手动用B2的CLI添加了
[
{
"corsRuleName": "downloadFromAnyOriginWithUpload",
"allowedOrigins": [
"*"
],
"allowedHeaders": [
"range"
],
"allowedOperations": [
"b2_download_file_by_id",
"b2_download_file_by_name",
"b2_upload_file",
"b2_upload_part"
],
"exposeHeaders": [
"authorization",
"x-bz-file-name",
"x-bz-content-sha1"
],
"maxAgeSeconds": 3600
}
]
然后Get Bucket可以看到CORS也生效了
"corsRules": [
{
"allowedHeaders": [
"range"
],
"allowedOperations": [
"b2_download_file_by_id",
"b2_upload_part",
"b2_upload_file",
"b2_download_file_by_name"
],
"allowedOrigins": [
"*"
],
"corsRuleName": "downloadFromAnyOriginWithUpload",
"exposeHeaders": [
"authorization",
"x-bz-file-name",
"x-bz-content-sha1"
],
"maxAgeSeconds": 3600
}
]
上传文件依然403, 这就很迷,是我CORS没设置对吗