mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #34316 from nextcloud/backport/34215/stable25
[stable25] Add cache header for image endpoint if link previews
This commit is contained in:
commit
904ac63310
1 changed files with 4 additions and 2 deletions
|
|
@ -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 a new issue