Allow CORS for b2_delete_file_version

According to the Backblaze B2 documentation: CORS: Cross-Origin Resource Sharing, I can only set cors for those capabilities :

  • b2_download_file_by_id
  • b2_download_file_by_name
  • b2_upload_file
  • b2_upload_part

I'm using b2 CLI to define CORS rules for my bucket, And all my requests work fine from my origin https:||foo.yz.

But when I try to delete a file using b2_delete_file_version API I get this error:

Access to fetch at 'https://api002.backblazeb2.com/b2api/v2/b2_delete_file_version' from origin 'https:||foo.yz' has been blocked by CORS policy
  • Although it works when I send my request from postman

but when I try to add this capability: "b2_delete_file_version" to my CORS rules it shows me that message :

unknown allowedOperation value

You're correct - at present, those are the only four B2 API operations that may be CORS-enabled. However, you could take advantage of B2's S3 compatibility; the following S3 compatible operations are supported for CORS:

  • s3_delete
  • s3_get
  • s3_head
  • s3_post
  • s3_put

If s3_delete doesn't work for you, please feel free to email our product management team at [email protected] with your use case and we can look at adding b2_delete_file_version.