diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-10-23 16:44:09 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-10-23 16:44:20 +0200 |
commit | b6981dcecb0fb80b3b519af70f2c29329fe2c2b0 (patch) | |
tree | a0042912470bd4be6e84ccf0e176fa1afb9b1781 /tests/lib/AppFramework/Http | |
parent | 26ca7a0e2f86cb76726073f2d73fd5cb8a1e09d9 (diff) | |
parent | 39338aaa676168b0a53c3a1f6d5363569f303361 (diff) | |
download | nextcloud-server-b6981dcecb0fb80b3b519af70f2c29329fe2c2b0.tar.gz nextcloud-server-b6981dcecb0fb80b3b519af70f2c29329fe2c2b0.zip |
Merge branch 'master' of https://github.com/nextcloud/server into gridview-table
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'tests/lib/AppFramework/Http')
-rw-r--r-- | tests/lib/AppFramework/Http/EmptyContentSecurityPolicyTest.php | 15 |
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()); + } } |