I have a WordPress site that I’ve developed a mobile app for, in the app I’d like to download some of the WordPress image files to store locally on the users device but I’m battling with CORS.
I’ve added the necessary header to the .htaccess as I’ve purged the Cloudflare cache as per the guide but it’s still not working and failing with the error that CORS needs to be enabled, I’m using this to test… Online Web service testing tool - Automated API testing
Thanks for the reply, looks like the problem is actually my hosting provider. I spoke to their support and they confirmed that they do not allow CORS on shared hosting.
Providing they don’t consider CORS headers to be some form of ToS violation, you can use Cloudflare Workers to add these to your responses if you need to and you’re comfortable writing Javascript code.
There’s a couple of examples of code in our dev docs you can use for inspiration: