I have deployed an app to Cloudflare Pages and set a custom domain yhimsical.com
The domain is managed with Cloudflare.
The issue is when the site is accessed through https://www.yhimsical.com
it loads the first time fine. But when you reload the page, the content is loaded through service worker and the Content-Security-Policy is not correct. As a result, none of the scripts, fonts, styles are being loaded. When you hard reload the page, the issue is not there. But refresh the page again and same issue happens.
Here is the CSP errors I get when I access the site with www:
Wrong CSP headers when accessed the site with www:
https://i.imgur.com/WH2s8DM.png
When the site is accessed without the www part, the Correct CSP headers is loaded and everything works fine:
https://i.imgur.com/Gn2602m.png
Any help would be appreciated.
Best Regards