diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-07-27 15:33:55 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-08-10 14:26:22 +0200 |
commit | b8c5008acf0e2bd04d9a72241943311db99cc833 (patch) | |
tree | 0a9ff07f363cf1aa07b9f928c622b56906e301af /tests | |
parent | 5d94590cee2b6d4733d4d1c788a882f67d2ae75d (diff) | |
download | nextcloud-server-b8c5008acf0e2bd04d9a72241943311db99cc833.tar.gz nextcloud-server-b8c5008acf0e2bd04d9a72241943311db99cc833.zip |
Add feature policy header
This adds the events and the classes to modify the feature policy.
It also adds a default restricted feature policy.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/AppFramework/Controller/ControllerTest.php | 1 | ||||
-rw-r--r-- | tests/lib/AppFramework/Http/DataResponseTest.php | 1 | ||||
-rw-r--r-- | tests/lib/AppFramework/Http/ResponseTest.php | 3 |
3 files changed, 4 insertions, 1 deletions
diff --git a/tests/lib/AppFramework/Controller/ControllerTest.php b/tests/lib/AppFramework/Controller/ControllerTest.php index c37a2a3456c..09d89aa70fd 100644 --- a/tests/lib/AppFramework/Controller/ControllerTest.php +++ b/tests/lib/AppFramework/Controller/ControllerTest.php @@ -117,6 +117,7 @@ class ControllerTest extends \Test\TestCase { 'Cache-Control' => 'no-cache, no-store, must-revalidate', 'Content-Type' => 'application/json; charset=utf-8', 'Content-Security-Policy' => "default-src 'none';base-uri 'none';manifest-src 'self'", + 'Feature-Policy' => "autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'", ]; $response = $this->controller->customDataResponse(array('hi')); diff --git a/tests/lib/AppFramework/Http/DataResponseTest.php b/tests/lib/AppFramework/Http/DataResponseTest.php index e0eca83f6e9..9cb99b06b65 100644 --- a/tests/lib/AppFramework/Http/DataResponseTest.php +++ b/tests/lib/AppFramework/Http/DataResponseTest.php @@ -69,6 +69,7 @@ class DataResponseTest extends \Test\TestCase { $expectedHeaders = [ 'Cache-Control' => 'no-cache, no-store, must-revalidate', 'Content-Security-Policy' => "default-src 'none';base-uri 'none';manifest-src 'self'", + 'Feature-Policy' => "autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'", ]; $expectedHeaders = array_merge($expectedHeaders, $headers); diff --git a/tests/lib/AppFramework/Http/ResponseTest.php b/tests/lib/AppFramework/Http/ResponseTest.php index e840111db19..9d6442ea3ce 100644 --- a/tests/lib/AppFramework/Http/ResponseTest.php +++ b/tests/lib/AppFramework/Http/ResponseTest.php @@ -60,6 +60,7 @@ class ResponseTest extends \Test\TestCase { $this->childResponse->setHeaders($expected); $headers = $this->childResponse->getHeaders(); $expected['Content-Security-Policy'] = "default-src 'none';base-uri 'none';manifest-src 'self'"; + $expected['Feature-Policy'] = "autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'"; $this->assertEquals($expected, $headers); } @@ -92,7 +93,7 @@ class ResponseTest extends \Test\TestCase { public function testAddHeaderValueNullDeletesIt(){ $this->childResponse->addHeader('hello', 'world'); $this->childResponse->addHeader('hello', null); - $this->assertEquals(2, count($this->childResponse->getHeaders())); + $this->assertEquals(3, count($this->childResponse->getHeaders())); } |