How to expose R2 objects' metadata in through public URL headers?

Hi, I have a question regarding Cloudflare R2.

I'm storing some objects on a Cloudflare R2 bucket with some custom metadata on each one. I want to make the bucket publicly accessible through URLs and have assigned custom domain for it. I've also configured its CORS policy with the 'x-amz-meta-<key>' header in the ExposeHeaders list.

But when I tested a GET request using Postman, although the request was successful and the response's Access-Control-Expose-Headers did contain 'x-amz-meta-<key>', I didn't get the actual 'x-amz-meta-<key>' header in the response.

I know I can achieve it with a worker in the middle, but it would add an extra hop that feels unnecessary, and might cost me some more money if the number of requests surpasses the free tier (almost certainly).

So Is there any way that I can get the object content together with its custom metadata in one fetch from the browser without going through a worker?
Was this page helpful?