IPFS returning car file instead of raw file

I am running a Kubo node and using it to serve files over a gateway
Sometimes it will randomly return a car file instead of the file I am trying to access
Any idea why this happens?

Can you show the requests you are doing and tell more about what your architecture is please.

My first guess would be some caching layer that does not add the Accept header as part of the cache key so if someone sent you a car request first, car gets cached then next person inline wants the file, has different Accept header but your cache doesn’t check that and send back car instead of plain file.

I have my kubo nodes deployed in k8s and i have a bunnycdn pullzone in front of that that caches most requests
I am using the ipfs gateway to deploy a site but sometimes it randomly returns a car file instead of the website

any idea why this might be happening?

Could it be that the CID you are fetching was added a CAR that was then encoded as a UnixFS file?

Alternatively, it could be that bunnycdn is not taking the Accept header into account.