Stripped information from HTTP headers by Cloudflare

Dear team and community,

I ran into an issue deploying a simple fastAPI that serves a binary file in chunks. The chunks byte range is specified in the header of my get-requests eg. {range: byte=0-2047}. At random, this content is stripped from the headers. I tried different clients with the same outcome. Some research in the Cloudflare community showed people experiencing similar issues, that might be caused by cloudflare’s caching/optimization. Could you customize the settings so that the range-header is respected? Or did anyone else experience this issue?

Thanks in advance!
Cheers, Joschka

Hey!

I was able to reproduce your issue. It is indeed linked to the way Cloudflare cache works. It operates on a strict set of URLs. The URL you query ends with .bin, which is one of the extensions cached by Cloudflare (full list here Default Cache Behavior · Cloudflare Cache (CDN) docs).
If you want to mitigate the issue immediately, don’t use one of those extensions.

We’re still looking into the issue exactly, because requests make their way to the Koyeb Instance, which is expected, but the range header is stripped. This is abnormal. I’ll comment back on this topic when we understand better the issue

Thanks a lot for the quick fix! I changed the endpoint, API is running smoothly. :partying_face:

1 Like

Happy that it works for you! We briefly checked what was going on and it seems that this mechanism is specific to the range header too.