Issue by mikelutz, jibran: [Symfony 4] JSON:API ResourceResponseSubscriber can pass NULL to Symfony\Component\HttpFoundation\Response::setCharset()

merge-requests/1119/head
Alex Pott 2019-03-28 09:10:11 +00:00
parent 7b81fcfc91
commit 0df3be0e23
No known key found for this signature in database
GPG Key ID: 31905460D4A69276
1 changed files with 3 additions and 1 deletions
core/modules/jsonapi/src/EventSubscriber

View File

@ -173,7 +173,9 @@ class ResourceResponseSubscriber implements EventSubscriberInterface {
$final_response->setContent($response->getContent());
$final_response->setStatusCode($response->getStatusCode());
$final_response->setProtocolVersion($response->getProtocolVersion());
$final_response->setCharset($response->getCharset());
if ($charset = $response->getCharset()) {
$final_response->setCharset($charset);
}
$final_response->headers = clone $response->headers;
if ($final_response instanceof CacheableResponseInterface) {
$final_response->addCacheableDependency($response->getCacheableMetadata());