core/modules/rest/src/EventSubscriber/ResourceResponseSubscriber.php | 1 + 1 file changed, 1 insertion(+) diff --git a/core/modules/rest/src/EventSubscriber/ResourceResponseSubscriber.php b/core/modules/rest/src/EventSubscriber/ResourceResponseSubscriber.php index 9c1a8cd..ba1e3eb 100644 --- a/core/modules/rest/src/EventSubscriber/ResourceResponseSubscriber.php +++ b/core/modules/rest/src/EventSubscriber/ResourceResponseSubscriber.php @@ -191,6 +191,7 @@ protected function flattenResponse(ResourceResponseInterface $response) { assert('!empty($response->getContent())'); $final_response = ($response instanceof CacheableResponseInterface) ? new CacheableResponse() : new Response(); $final_response->setContent($response->getContent()); + $final_response->setStatusCode($response->getStatusCode()); $final_response->headers->add($response->headers->all()); if ($final_response instanceof CacheableResponseInterface) { $final_response->addCacheableDependency($response->getCacheableMetadata());