I have deployed an app to Cloudflare Pages and set a custom domain
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:
When the site is accessed without the www part, the Correct CSP headers is loaded and everything works fine:
Any help would be appreciated.