summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-10-16 14:04:22 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-10-21 13:38:32 +0200
commit579822b6a5639ee608e11ed23760d481a4a78f4b (patch)
tree59129f958c51b19bfd2fea5d50107cf1f37feda8 /tests
parentf544c9fec9e24f7216aafdada680378044ddaf61 (diff)
downloadnextcloud-server-579822b6a5639ee608e11ed23760d481a4a78f4b.tar.gz
nextcloud-server-579822b6a5639ee608e11ed23760d481a4a78f4b.zip
Add report-uri to CSP
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/AppFramework/Http/EmptyContentSecurityPolicyTest.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/lib/AppFramework/Http/EmptyContentSecurityPolicyTest.php b/tests/lib/AppFramework/Http/EmptyContentSecurityPolicyTest.php
index 7c30df730d3..7e86903892f 100644
--- a/tests/lib/AppFramework/Http/EmptyContentSecurityPolicyTest.php
+++ b/tests/lib/AppFramework/Http/EmptyContentSecurityPolicyTest.php
@@ -451,4 +451,19 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->contentSecurityPolicy->addAllowedScriptDomain("'self'");
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
+
+ public function testGetPolicyWithReportUri() {
+ $expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';report-uri https://my-report-uri.com";
+
+ $this->contentSecurityPolicy->addReportTo("https://my-report-uri.com");
+ $this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
+ }
+
+ public function testGetPolicyWithMultipleReportUri() {
+ $expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';report-uri https://my-report-uri.com https://my-other-report-uri.com";
+
+ $this->contentSecurityPolicy->addReportTo("https://my-report-uri.com");
+ $this->contentSecurityPolicy->addReportTo("https://my-other-report-uri.com");
+ $this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
+ }
}