download csp and fix

This commit is contained in:
Yuri Kuznetsov
2022-08-22 11:37:26 +03:00
parent 76d9b3cf9c
commit c40070ceb0

View File

@@ -93,11 +93,13 @@ class Download implements EntryPoint
$disposition = 'attachment';
/** @var {string[]} $inlineMimeTypeList */
/** @var string[] $inlineMimeTypeList */
$inlineMimeTypeList = $this->metadata->get(['app', 'file', 'inlineMimeTypeList']) ?? [];
if (in_array($type, $inlineMimeTypeList)) {
$disposition = 'inline';
$response->setHeader('Content-Security-Policy', "default-src 'self'");
}
$response->setHeader('Content-Description', 'File Transfer');