Skip to content

Commit 95e4ef5

Browse files
committed
Add CSP for GTM.
1 parent 36277b9 commit 95e4ef5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pgweb/util/middleware.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ def __call__(self, request):
4646
sources = OrderedDict([
4747
('default', ["'self'", ]),
4848
('img', ['*', 'data:', ]),
49-
('script', ["'self'", "www.google-analytics.com", "ssl.google-analytics.com", "data:"]),
49+
('script', ["'unsafe-eval'", "'self'", "www.google-analytics.com", "ssl.google-analytics.com", "www.googletagmanager.com", "tagmanager.google.com", "data:"]),
5050
('connect', ["'self'", "www.google-analytics.com", "ssl.google-analytics.com"]),
5151
('media', ["'self'", ]),
52-
('style', ["'self'", "fonts.googleapis.com"]),
52+
('style', ["'self'", "fonts.googleapis.com", "tagmanager.google.com"]),
5353
('font', ["'self'", "fonts.gstatic.com", "data:", ]),
5454
])
5555
if hasattr(response, 'x_allow_extra_sources'):

0 commit comments

Comments
 (0)