Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (18 sloc) 861 Bytes

Content Security Policy plugin for Craft CMS 3.x

Content Security Policy (or CSP) generator using nonces.


  • Craft 3.0.0


To install the plugin, search the plugin store for "Content Security Policy" or:

composer require born05/craft-csp

Setting up

Either config using config/content-security-policy.php or use nonces:

<script src="url/of/script.js" nonce="{{ cspNonce('script-src') }}"></script>
<link src="url/of/script.js" nonce="{{ cspNonce('script-src') }}"></script>
<link href="url/of/style.css" rel="stylesheet" nonce="{{ cspNonce('style-src') }}" />

For config options see: Settings.php


Copyright © Born05

See license

You can’t perform that action at this time.