Skip to content

Commit

Permalink
improving json support with charset in the content-type header
Browse files Browse the repository at this point in the history
  • Loading branch information
markhuot committed Nov 18, 2023
1 parent a8a2425 commit 835c7e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/behaviors/TestableResponseBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function __call($method, $args)
*/
function getJsonContent()
{
if ($this->response->headers->get('content-type') !== 'application/json') {
if (! str_contains($this->response->headers->get('content-type'), 'application/json')) {
throw new \Exception('The response does not have a JSON content-type to get JSON data from');
}

Expand Down

0 comments on commit 835c7e9

Please sign in to comment.