summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-05-19 14:48:27 +0200
committerGitHub <noreply@github.com>2020-05-19 14:48:27 +0200
commitd26169838eaca3325a3a424082b1c854d3ddc091 (patch)
treed77ba8f0f4c7773579dd23d159cff7e3b6244d31
parent7a22039ce01960cd7606f1d22cb8ddabb0782eb5 (diff)
parentc92c378a9c6406265c60c08462b0378dbeaad978 (diff)
downloadnextcloud-server-d26169838eaca3325a3a424082b1c854d3ddc091.tar.gz
nextcloud-server-d26169838eaca3325a3a424082b1c854d3ddc091.zip
Merge pull request #21041 from nextcloud/enh/dataresponse_etag_lastmod
Copy over the ETag and LastModified when formatting a Dataresponse
-rw-r--r--lib/public/AppFramework/Controller.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/public/AppFramework/Controller.php b/lib/public/AppFramework/Controller.php
index ca35d723242..db1f95634e0 100644
--- a/lib/public/AppFramework/Controller.php
+++ b/lib/public/AppFramework/Controller.php
@@ -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);