Unverified Commit db425571 authored by larowlan's avatar larowlan
Browse files

Issue #3027835 by Gábor Hojtsy, catch: [symfony 4] Argument 1 passed to...

Issue #3027835 by Gábor Hojtsy, catch: [symfony 4]  Argument 1 passed to Symfony\Component\HttpFoundation\Response::setCharset() must be of the type string, null given
parent 751b3842
......@@ -40,7 +40,9 @@ public static function createFromRedirectResponse(RedirectResponse $response) {
*/
protected function fromResponse(RedirectResponse $response) {
$this->setProtocolVersion($response->getProtocolVersion());
$this->setCharset($response->getCharset());
if ($response->getCharset()) {
$this->setCharset($response->getCharset());
}
// Cookies are separate from other headers and have to be copied over
// directly.
foreach ($response->headers->getCookies() as $cookie) {
......
......@@ -207,7 +207,9 @@ protected function flattenResponse(ResourceResponseInterface $response) {
$final_response->setContent($response->getContent());
$final_response->setStatusCode($response->getStatusCode());
$final_response->setProtocolVersion($response->getProtocolVersion());
$final_response->setCharset($response->getCharset());
if ($response->getCharset()) {
$final_response->setCharset($response->getCharset());
}
$final_response->headers = clone $response->headers;
if ($final_response instanceof CacheableResponseInterface) {
$final_response->addCacheableDependency($response->getCacheableMetadata());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment