Remove content-type check on toArray methods

This commit is contained in:
Jérémy Derussé 2020-10-13 17:26:48 +02:00
parent af8a21f0af
commit 1c8fff18f9
No known key found for this signature in database
GPG Key ID: 2083FA5758C473D2

View File

@ -143,12 +143,6 @@ trait ResponseTrait
return $this->jsonData;
}
$contentType = $this->headers['content-type'][0] ?? 'application/json';
if (!preg_match('/\bjson\b/i', $contentType)) {
throw new JsonException(sprintf('Response content-type is "%s" while a JSON-compatible one was expected for "%s".', $contentType, $this->getInfo('url')));
}
try {
$content = json_decode($content, true, 512, \JSON_BIGINT_AS_STRING | (\PHP_VERSION_ID >= 70300 ? \JSON_THROW_ON_ERROR : 0));
} catch (\JsonException $e) {