waughj / content-security-policy
Class for easy generation o’ Content Security Policy header.
Installs: 50
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/waughj/content-security-policy
Requires
- php: >=7.2
README
Class for easy generation o’ Content Security Policy header.
Example
use WaughJ\ContentSecurityPolicy\ContentSecurityPolicy;
ContentSecurityPolicy::setPolicies
([
'default-src' => [ "'self'" ],
'style-src' => [ "'self'", "fonts.googleapis.com", "'unsafe-inline'" ],
'script-src' => [ "'self'", "*.google-analytics.com", "*.googletagmanager.com", "'unsafe-inline'" ],
'font-src' => [ "'self'", "fonts.gstatic.com" ],
'img-src' => [ "'self'", "*.google-analytics.com" ],
'script-src-elem' => [ "'self'", "*.google-analytics.com", "*.googletagmanager.com", "'unsafe-inline'" ]
]);
Changelog
1.0.0
- Remake & simplify