CloudFlare serves wrong content-type (text/html instead of application/json)

I have an simple script which generates an json object and outputs it to the browser.
It servers with the correct content-type (application/json).

But when i reload the same url i serves through CloudFlare with content-type text/html.
This causes errors in the scripts and is not desired.

Some data:

  • script url is like[endpoint]
  • written in php, which sends the content-type header
  • the first run is always right, every hit from there on not
  • screenshot of the first call (sorry only allowed to upload one image)

Is there something i’m missing? And can it be done?

Can you post a working example link?