Chrome view source of js file not working as expected

I upgraded my website to CF. Now when I try to view the source in Chrome of js file from my domain, it downloads the file instead of showing it.
I tried to download it, right click on file and set “always open this type of file”, but this option is disabled.
How to solve this problem?

I’m unable to replicate this on my own domains.

You can view the contents of a file using your browser’s Dev Tools (F12, I believe), then use the Network tab to get a list of resources from that page.

Thanks, but still does not solve the behavior.
Please see for example:
Chrome tries to download it, instead of viewing it.

That file is sent as a content-type: binary/octet-stream

Cloudflare doesn’t change content-type headers unless you’ve done this with a Worker.

1 Like

Thanks, so I have to change the type in the origin server?
What type should I change it to?


1 Like

Thanks, are there browsers that do not accept binary/octet-stream for js files?

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.