Copy over the ETag and LastModified when formatting a Dataresponse
This way the ETag checks etc are all working. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
187eedf443
commit
c92c378a9c
|
@ -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 New Issue