mirror of
https://github.com/nextcloud/server.git
synced 2026-03-21 18:11:02 -04:00
Merge pull request #36807 from nextcloud/fix/noid/missing-cached-reference-image-mimetype
Avoid getting null mimetype when getting reference preview
This commit is contained in:
commit
00a7478d8d
1 changed files with 4 additions and 1 deletions
|
|
@ -58,10 +58,13 @@ class ReferenceController extends Controller {
|
|||
$appData = $this->appDataFactory->get('core');
|
||||
$folder = $appData->getFolder('opengraph');
|
||||
$file = $folder->getFile($referenceId);
|
||||
$contentType = $reference === null || $reference->getImageContentType() === null
|
||||
? $file->getMimeType()
|
||||
: $reference->getImageContentType();
|
||||
$response = new DataDownloadResponse(
|
||||
$file->getContent(),
|
||||
$referenceId,
|
||||
$reference === null ? $file->getMimeType() : $reference->getImageContentType()
|
||||
$contentType
|
||||
);
|
||||
} catch (NotFoundException|NotPermittedException $e) {
|
||||
$response = new DataResponse('', Http::STATUS_NOT_FOUND);
|
||||
|
|
|
|||
Loading…
Reference in a new issue