R2 double gzipped files with 'Content-Encoding: gzip'

I’m having problem serving gzipped file

My file is already gzipped before upload, it has Content-Encoding: gzip (double checked in response headers & through rclone) but the result in Chrome is not decompressed.
I guess the file is double gzipped by Cloudflare, so the final decompressed result in Chrome is still the original gzipped content.

I tried different Content-type that is not listed here to avoid Cloudflare recompression but no luck.

I also tried to set cache-control: no-transform (according to this) but then the response header Content-Encoding: gzip is omitted, so Chrome also can’t decompress it correctly.

(Might related: my files has custom extension)

Can you share a sample URL?

Have you tried a transform rule to remove the Accept-Encoding header from Requests?

This is some sample url (when correctly decompressed, it will display the text: “This is the decompressed content”):

Raw (non-gzipped) file: https://pub-e7d9ef494d904c88ac11cbfb1a4715a5.r2.dev/raw.txt

Gzipped file with Content-Encoding: gzip

Gzipped file with Content-Encoding: gzip and Cache-Control: no-transform


Gzipped file with Content-Encoding: gzip and content-type: application/octet-stream

Gzipped file with Content-Encoding: gzip and content-type: application/octet-stream and Cache-Control: no-transform

When file has Cache-Control: no-transform, is is supposed to omit the original Content-Encoding in response header?
Are there any workaround for this?