mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
Merge pull request #21047 from nextcloud/backport/21041/stable19
[stable19] Copy over the ETag and LastModified when formatting a Dataresponse
This commit is contained in:
commit
5763ce2761
1 changed files with 8 additions and 0 deletions
|
|
@ -91,6 +91,14 @@ abstract class Controller {
|
|||
unset($headers['Content-Type']);
|
||||
}
|
||||
$response->setHeaders(array_merge($dataHeaders, $headers));
|
||||
|
||||
if ($data->getETag() !== null) {
|
||||
$response->setETag($data->getETag());
|
||||
}
|
||||
if ($data->getLastModified() !== null) {
|
||||
$response->setLastModified($data->getLastModified());
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
return new JSONResponse($data);
|
||||
|
|
|
|||
Loading…
Reference in a new issue