Skip to content
This repository was archived by the owner on Jun 12, 2023. It is now read-only.

Commit fa1b073

Browse files
committed
Merge pull request #23 from eugenegp/master
for fixing bug #21
2 parents 7779ccd + 79da366 commit fa1b073

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Diff for: src/Behat/Mink/Driver/Goutte/Client.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,15 @@ class Client extends BaseClient
2727
protected function createResponse(GuzzleResponse $response)
2828
{
2929
$body = $response->getBody(true);
30-
$statusCode = $response->getStatusCode();
31-
$headers = $response->getHeaders()->getAll();
3230
$contentType = $response->getContentType();
3331

3432
if (!$contentType || false === strpos($contentType, 'charset=')) {
3533
if (preg_match('/\<meta[^\>]+charset *= *["\']?([a-zA-Z\-0-9]+)/i', $body, $matches)) {
3634
$contentType .= ';charset='.$matches[1];
3735
}
3836
}
39-
$headers['Content-Type'] = $contentType;
37+
$response->setHeader('Content-Type', $contentType);
4038

41-
return new Response($body, $statusCode, $headers);
39+
return parent::createResponse($response);
4240
}
4341
}

0 commit comments

Comments
 (0)