Skip to content

Commit

Permalink
Merge pull request #5915 from nextcloud/backport/5903/stable22
Browse files Browse the repository at this point in the history
[stable22] Use extended mediarecorder
  • Loading branch information
nickvergessen authored Jul 1, 2021
2 parents 0656993 + 6a17914 commit 06f1cdc
Show file tree
Hide file tree
Showing 9 changed files with 1,904 additions and 332 deletions.
3 changes: 2 additions & 1 deletion lib/Chat/SystemMessage/Listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ public static function register(IEventDispatcher $dispatcher): void {
$metaData = is_array($metaData) ? $metaData : [];

if (isset($metaData['messageType']) && $metaData['messageType'] === 'voice-message') {
if ($share->getNode()->getMimeType() !== 'audio/mpeg') {
if ($share->getNode()->getMimeType() !== 'audio/mpeg'
&& $share->getNode()->getMimeType() !== 'audio/wav') {
unset($metaData['messageType']);
}
}
Expand Down
16 changes: 16 additions & 0 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,14 @@ public function index(string $token = '', string $callUser = '', string $passwor
$csp = new ContentSecurityPolicy();
$csp->addAllowedConnectDomain('*');
$csp->addAllowedMediaDomain('blob:');
$csp->addAllowedWorkerSrcDomain('blob:');
$csp->addAllowedWorkerSrcDomain("'self'");
$csp->addAllowedChildSrcDomain('blob:');
$csp->addAllowedChildSrcDomain("'self'");
$csp->addAllowedScriptDomain('blob:');
$csp->addAllowedScriptDomain("'self'");
$csp->addAllowedConnectDomain('blob:');
$csp->addAllowedConnectDomain("'self'");
$csp->addAllowedImageDomain('https://*.tile.openstreetmap.org');
$response->setContentSecurityPolicy($csp);
return $response;
Expand Down Expand Up @@ -315,6 +323,14 @@ protected function guestEnterRoom(string $token, string $password): Response {
$csp = new ContentSecurityPolicy();
$csp->addAllowedConnectDomain('*');
$csp->addAllowedMediaDomain('blob:');
$csp->addAllowedWorkerSrcDomain('blob:');
$csp->addAllowedWorkerSrcDomain("'self'");
$csp->addAllowedChildSrcDomain('blob:');
$csp->addAllowedChildSrcDomain("'self'");
$csp->addAllowedScriptDomain('blob:');
$csp->addAllowedScriptDomain("'self'");
$csp->addAllowedConnectDomain('blob:');
$csp->addAllowedConnectDomain("'self'");
$csp->addAllowedImageDomain('https://*.tile.openstreetmap.org');
$response->setContentSecurityPolicy($csp);
return $response;
Expand Down
8 changes: 8 additions & 0 deletions lib/Listener/CSPListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ public function handle(Event $event): void {

$csp = new ContentSecurityPolicy();
$csp->addAllowedImageDomain('https://*.tile.openstreetmap.org');
$csp->addAllowedWorkerSrcDomain('blob:');
$csp->addAllowedWorkerSrcDomain("'self'");
$csp->addAllowedChildSrcDomain('blob:');
$csp->addAllowedChildSrcDomain("'self'");
$csp->addAllowedScriptDomain('blob:');
$csp->addAllowedScriptDomain("'self'");
$csp->addAllowedConnectDomain('blob:');
$csp->addAllowedConnectDomain("'self'");
foreach ($this->config->getAllServerUrlsForCSP() as $server) {
$csp->addAllowedConnectDomain($server);
}
Expand Down
Loading

0 comments on commit 06f1cdc

Please sign in to comment.