diff --git a/src/Behat/Mink/Driver/Goutte/Client.php b/src/Behat/Mink/Driver/Goutte/Client.php index 358b249..e285702 100644 --- a/src/Behat/Mink/Driver/Goutte/Client.php +++ b/src/Behat/Mink/Driver/Goutte/Client.php @@ -27,8 +27,6 @@ class Client extends BaseClient protected function createResponse(GuzzleResponse $response) { $body = $response->getBody(true); - $statusCode = $response->getStatusCode(); - $headers = $response->getHeaders()->getAll(); $contentType = $response->getContentType(); if (!$contentType || false === strpos($contentType, 'charset=')) { @@ -36,8 +34,8 @@ protected function createResponse(GuzzleResponse $response) $contentType .= ';charset='.$matches[1]; } } - $headers['Content-Type'] = $contentType; + $response->setHeader('Content-Type', $contentType); - return new Response($body, $statusCode, $headers); + return parent::createResponse($response); } }