PHP Classes

File: CSPGenerator.php

Recommend this page to a friend!
  Classes of Tom Postma   PHP Content Security Policy generator   CSPGenerator.php  
File: CSPGenerator.php
Role: Class source
Content type: text/plain
Description: CSPGenerator class
Class: PHP Content Security Policy generator
Generate CSP headers to prevent security attacks
Author: By
Last change: Added example with use of require-sri-for directive.
Fixed removed double require-sri-for directive.

Signed-off-by: Tom <>
Merge branch 'master' of

# Conflicts:
# CSPGenerator.php
Added setReportConsent option for enabling the reportTo directive which is now disabled by default.

Signed-off-by: Tom <>
added worker-src directive, decreate child-src directive.

update copyright notice, improved codestyle, update code documentation

Signed-off-by: Tom <>
Renamed reporturi to reportto directive.

Signed-off-by: Tom <>
Added support for sending the Referrer-Policy http header base on the current referrerpolicy value and added strict-origin-when-cross-origin and strict-origin values.

Signed-off-by: Tom <>
stop using reflected-xss directive from chrome 54 because of unrecognized directive(not yet implemented)console errors.

Signed-off-by: Tom <>
Date: 5 years ago
Size: 45,320 bytes

You need to be a registered user and login to get this file.

Login Immediately with your account on: