diff options
author | Oleg <markelog@gmail.com> | 2013-10-30 16:20:38 +0400 |
---|---|---|
committer | Oleg <markelog@gmail.com> | 2013-11-07 20:16:19 +0100 |
commit | ee0d0e6e3f3773d15d3b9c3d654a05cbb914d7ab (patch) | |
tree | 1ad4232dc5153cb117050ad608982e3d60b58b29 /test/data | |
parent | c66a5e70f2745048b30b7e7e8801d70ce9c640c7 (diff) | |
download | jquery-ee0d0e6e3f3773d15d3b9c3d654a05cbb914d7ab.tar.gz jquery-ee0d0e6e3f3773d15d3b9c3d654a05cbb914d7ab.zip |
Add more thorough check for CSP violations
Diffstat (limited to 'test/data')
-rw-r--r-- | test/data/support/csp-clean.php | 3 | ||||
-rw-r--r-- | test/data/support/csp-log.php | 3 | ||||
-rwxr-xr-x | test/data/support/csp.log | 0 | ||||
-rw-r--r-- | test/data/support/csp.php | 11 |
4 files changed, 9 insertions, 8 deletions
diff --git a/test/data/support/csp-clean.php b/test/data/support/csp-clean.php new file mode 100644 index 000000000..e16d047a3 --- /dev/null +++ b/test/data/support/csp-clean.php @@ -0,0 +1,3 @@ +<?php + file_put_contents("csp.log", "", LOCK_EX); +?> diff --git a/test/data/support/csp-log.php b/test/data/support/csp-log.php new file mode 100644 index 000000000..efbb9d7bc --- /dev/null +++ b/test/data/support/csp-log.php @@ -0,0 +1,3 @@ +<?php + file_put_contents("csp.log", "error", LOCK_EX); +?> diff --git a/test/data/support/csp.log b/test/data/support/csp.log new file mode 100755 index 000000000..e69de29bb --- /dev/null +++ b/test/data/support/csp.log diff --git a/test/data/support/csp.php b/test/data/support/csp.php index b21ce0f74..d01def783 100644 --- a/test/data/support/csp.php +++ b/test/data/support/csp.php @@ -1,12 +1,7 @@ <?php - # Support: Firefox - header("X-Content-Security-Policy: default-src 'self';"); - - # Support: Webkit, Safari 5 - # http://stackoverflow.com/questions/13663302/why-does-my-content-security-policy-work-everywhere-but-safari - header("X-WebKit-CSP: script-src " . $_SERVER["HTTP_HOST"] . " 'self'"); - - header("Content-Security-Policy: default-src 'self'"); + # This test page checkes CSP only for browsers with "Content-Security-Policy" header support + # i.e. no old WebKit or old Firefox + header("Content-Security-Policy: default-src 'self'; report-uri csp-log.php"); ?> <!DOCTYPE html> <html> |