I am writing a CSP for my website, the header is added via Lambda@Edge on AWS for my site on lightsail. I've got the CSP set as follows, been trying to get it to work: content-security-policy: default-src 'self' *.thetechcapsule.com thetechcapsule.com; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
My domain is thetechcapsule.com and I have cloudfront CDN set up via www.thetechcapsule.com. I thought the wildcard would allow all subdomains but it's not working, getting script errors, but they should be using the default source?
E.g of error in console
Refused to load the script '<URL>' because it violates the following Content Security Policy directive: "script-src 'self'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.
Thanks