Here’s my helmetOptions.contentSecurityPolicy.directives.connectSrc:
[
"'self'",
"http://myDomainName",
"ws://myDomainName",
"https://*.myServiceProvider_1.io/",
"https://*.myServiceProvider_2.com/",
"https://*.myServiceProvider_3.net/",
"https://*.google-analytics.com/",
"https://*.google.com/",
"https://stats.g.doubleclick.net/",
"https://analytics.google.com/",
[.....]
]
It gets added to my site’s CSP and on local dev, everything works as expected.
In the Network tab of browser dev tools, you can see what the CSP looks like as received by the browser. Here’s what it is on local dev for connect-src:
[.....] connect-src 'self' http://myDomainName ws://myDomainName https://*.myServiceProvider_1.io/ https://*.myServiceProvider_2.com/ https://*.myServiceProvider_3.net/ https://*.google-analytics.com/ https://*.google.com/ https://stats.g.doubleclick.net/ https://analytics.google.com/ [.....];
But here’s what it looks like in production, hosted on Galaxy:
[.....]connect-src * 'self';
There’s nothing there – it’s all missing.
How can that be?
Most of the rest of my CSP is on the production site, but there are other anomalies in that CSP as well. I’m listing just this one in the hope that if I fix it, the others will also be fixed.