Skip to content
This repository has been archived by the owner on Jan 14, 2022. It is now read-only.

Content security policy issue - Closes #808 #811

Merged
merged 3 commits into from
Sep 7, 2018

Conversation

lsilvs
Copy link
Contributor

@lsilvs lsilvs commented Sep 7, 2018

What was the problem?

After implementation of Google Tag Manager the console intermittently shows a img-src CSP violation. It happens because GTM loads some assets onto the page to keep track of it and for some reason the source of these assets can change based on the location where the page is accessed.

How did I fix it?

As the list of possibles domains for google is very long (google.com, google.de, google.co.uk, etc..) to be whitelisted, I've expanded the img-src policy to any secure source (https).
In addition, I've restricted the script-src by removing the unsafe-inline and adding the inline script hash instead.

How to test it?

Load the page and check the console.

Review checklist

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants