Add CSP for GTM.

This commit is contained in:
Dave Page
2020-07-02 16:26:08 +01:00
parent 36277b95a7
commit 95e4ef533d

View File

@ -46,10 +46,10 @@ class PgMiddleware(object):
sources = OrderedDict([
('default', ["'self'", ]),
('img', ['*', 'data:', ]),
('script', ["'self'", "www.google-analytics.com", "ssl.google-analytics.com", "data:"]),
('script', ["'unsafe-eval'", "'self'", "www.google-analytics.com", "ssl.google-analytics.com", "www.googletagmanager.com", "tagmanager.google.com", "data:"]),
('connect', ["'self'", "www.google-analytics.com", "ssl.google-analytics.com"]),
('media', ["'self'", ]),
('style', ["'self'", "fonts.googleapis.com"]),
('style', ["'self'", "fonts.googleapis.com", "tagmanager.google.com"]),
('font', ["'self'", "fonts.gstatic.com", "data:", ]),
])
if hasattr(response, 'x_allow_extra_sources'):