mirror of https://github.com/nextcloud/server
Add cache header for image endpoint if link previews
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
20b75480d0
commit
f4a2ab137b
|
@ -59,9 +59,11 @@ class ReferenceController extends Controller {
|
|||
$appData = $this->appDataFactory->get('core');
|
||||
$folder = $appData->getFolder('opengraph');
|
||||
$file = $folder->getFile($referenceId);
|
||||
return new DataDownloadResponse($file->getContent(), $referenceId, $reference->getImageContentType());
|
||||
$response = new DataDownloadResponse($file->getContent(), $referenceId, $reference->getImageContentType());
|
||||
} catch (NotFoundException|NotPermittedException $e) {
|
||||
return new DataResponse('', Http::STATUS_NOT_FOUND);
|
||||
$response = new DataResponse('', Http::STATUS_NOT_FOUND);
|
||||
}
|
||||
$response->cacheFor(3600, false, true);
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue