Skip to content

Commit 7e2092c

Browse files
authored
Merge pull request #13411 from nextcloud/backport/13403/stable15
[stable15] CSP: Allow fonts to be provided in data
2 parents dcb4360 + de30c11 commit 7e2092c

6 files changed

Lines changed: 64 additions & 63 deletions

File tree

lib/public/AppFramework/Http/ContentSecurityPolicy.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class ContentSecurityPolicy extends EmptyContentSecurityPolicy {
8080
/** @var array Domains from which fonts can be loaded */
8181
protected $allowedFontDomains = [
8282
'\'self\'',
83+
'data:',
8384
];
8485
/** @var array Domains from which web-workers and nested browsing content can load elements */
8586
protected $allowedChildSrcDomains = [];

tests/lib/AppFramework/Controller/ControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function testFormatDataResponseJSON() {
116116
'test' => 'something',
117117
'Cache-Control' => 'no-cache, no-store, must-revalidate',
118118
'Content-Type' => 'application/json; charset=utf-8',
119-
'Content-Security-Policy' => "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self';connect-src 'self';media-src 'self'",
119+
'Content-Security-Policy' => "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self'",
120120
];
121121

122122
$response = $this->controller->customDataResponse(array('hi'));

0 commit comments

Comments
 (0)