# After upgrade the content security policy script src for GTM

**URL:** https://meta.discourse.org/t/after-upgrade-the-content-security-policy-script-src-for-gtm/186326
**Category:** Data & reporting
**Created:** [April 10, 2021, 3:28pm UTC](https://meta.discourse.org/t/after-upgrade-the-content-security-policy-script-src-for-gtm/186326 "2021-04-10T15:28:14Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![honeymoose](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/honeymoose/32/198718_2.png) [@honeymoose](https://meta.discourse.org/u/honeymoose)
#### Post date: [April 10, 2021, 3:28pm UTC](https://meta.discourse.org/t/after-upgrade-the-content-security-policy-script-src-for-gtm/186326/1 "2021-04-10T15:28:14Z")

</div>

we was updated Discourse @ 2021-04-08.

Then we noticed the content\_security\_policy may have some issue.

GTM for content security policy script src

 ![2021-04-10_11-25-49](https://global.discourse-cdn.com/meta/original/3X/a/0/a0ff8a1441481fe14a4aa7e769a6e28b625cd54c.png)

F12 for console:

 ![2021-04-10_11-26-52](https://global.discourse-cdn.com/meta/original/3X/b/c/bc0f117df1208bdbd2a855537f1da9d71b1e682f.png)

This happened updated to newest version of discourse.

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [April 10, 2021, 4:35pm UTC](https://meta.discourse.org/t/after-upgrade-the-content-security-policy-script-src-for-gtm/186326/2 "2021-04-10T16:35:08Z")

</div>

Can you show us the full CSP header as sent?

---

<div class="post-metadata">

### Author: ![honeymoose](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/honeymoose/32/198718_2.png) [@honeymoose](https://meta.discourse.org/u/honeymoose)
#### Post date: [April 10, 2021, 5:33pm UTC](https://meta.discourse.org/t/after-upgrade-the-content-security-policy-script-src-for-gtm/186326/3 "2021-04-10T17:33:42Z")

</div>

@supermathie

Thank you very much for your quick response.

I tried to load header from Firefox, I am not sure did I do something right.

Please see attachment of the screen.

 ![2021-04-10_13-15-48](https://global.discourse-cdn.com/meta/original/3X/c/d/cd9ebb193a4d74b5c7444bf1f0b3c4c0558059e3.png)

Changed to Chrome.

In here, maybe you can have more detail for the request.

 ![2021-04-10_13-32-02](https://global.discourse-cdn.com/meta/original/3X/0/4/04bc3c4d2a14f6c0e9ba572aa3075011c393ed9f.png)

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [April 12, 2021, 5:17pm UTC](https://meta.discourse.org/t/after-upgrade-the-content-security-policy-script-src-for-gtm/186326/4 "2021-04-12T17:17:09Z")

</div>

Things must have changed since the original post since it’s now behaving as it should:

```plaintext
○ → curl -I https://www.ossez.com
HTTP/2 200 
…
content-security-policy: base-uri 'none'; object-src 'none'; script-src https://www.ossez.com/logs/ https://www.ossez.com/sidekiq/ https://www.ossez.com/mini-profiler-resources/ https://www.ossez.com/assets/ https://www.ossez.com/brotli_asset/ https://www.ossez.com/extra-locales/ https://www.ossez.com/highlight-js/ https://www.ossez.com/javascripts/ https://www.ossez.com/plugins/ https://www.ossez.com/theme-javascripts/ https://www.ossez.com/svg-sprite/ https://www.googletagmanager.com/gtm.js 'nonce-38d2a45e5e933b869e14465772b2c0de' https: https://tagmanager.google.com https://www.googletagmanager.com 'unsafe-inline' https://analytics.ossez.com/matomo.js https://www.ossez.com/cdn-cgi/apps/head/qk5vBDFy7qBIoPy3q8a6LUoKei8.js https://www.googletagmanager.com/gtm.js; worker-src 'self' https://www.ossez.com/assets/ https://www.ossez.com/brotli_asset/ https://www.ossez.com/javascripts/ https://www.ossez.com/plugins/

```

‘unsafe-inline’ is now properly quoted, but is being ignored by Chrome:

> Refused to execute inline script because it violates the following Content Security Policy directive: […] Note that ‘unsafe-inline’ is ignored if either a hash or nonce value is present in the source list.

and Firefox:

> Content Security Policy: Ignoring “‘unsafe-inline’” within script-src or style-src: nonce-source or hash-source specified

since you’ve specified a nonce value in the CSP list: `'nonce-38d2a45e5e933b869e14465772b2c0de'`

I see that you’re behind Cloudflare; please note that you have to disable [various Cloudflare features](https://meta.discourse.org/t/full-site-cdn-acceleration-for-discourse/21467) since by default they will break Discourse.

---

<div class="post-metadata">

### Author: ![honeymoose](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/honeymoose/32/198718_2.png) [@honeymoose](https://meta.discourse.org/u/honeymoose)
#### Post date: [April 13, 2021, 3:26pm UTC](https://meta.discourse.org/t/after-upgrade-the-content-security-policy-script-src-for-gtm/186326/5 "2021-04-13T15:26:52Z")

</div>

Thank you very much.
