Add more CSP rules

This commit is contained in:
Vesa Luusua 2018-03-15 14:15:26 +02:00
parent 366f3e9606
commit 44dca2dd80

View file

@ -29,9 +29,8 @@ module.exports = (reportUri, enforceSsl, reportOnly) => {
const googleAnalytics = 'https://www.google-analytics.com/';
const googleAnalyticsDoubleClick = 'https://stats.g.doubleclick.net/';
const googleMaps = 'https://maps.googleapis.com/';
const googleStaticCsi = 'https://csi.gstatic.com/';
const googleStaticFonts = 'https://fonts.gstatic.com/';
const googleStaticMaps = 'https://maps.gstatic.com/';
const googleStatic = '*.gstatic.com';
const googleFonts = 'https://fonts.googleapis.com/';
const stripeJs = 'https://js.stripe.com/';
const stripeQ = 'https://q.stripe.com/';
@ -42,17 +41,7 @@ module.exports = (reportUri, enforceSsl, reportOnly) => {
const styleSrc = [self, inline, googleFonts];
const imgSrc = [
self,
data,
imgix,
loremPixel,
placeholder,
stripeQ,
googleMaps,
googleStaticCsi,
googleStaticMaps,
];
const imgSrc = [self, data, imgix, loremPixel, placeholder, stripeQ, googleMaps, googleStatic];
const connectSrc = [self, sharetribeApi, googleMaps, stripeApi];
@ -67,6 +56,7 @@ module.exports = (reportUri, enforceSsl, reportOnly) => {
imgSrc.push(googleAnalytics);
imgSrc.push(googleAnalyticsDoubleClick);
connectSrc.push(googleAnalytics);
connectSrc.push(googleAnalyticsDoubleClick);
}
if (sentryClientEnabled) {
connectSrc.push(sentryApi);