1
0
Fork 0

Fix handling of json error responses

pull/10152/head
Jordi Boggiano 2021-10-12 17:32:59 +02:00
parent cb1e248258
commit 1e3f7cfcba
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 1 additions and 1 deletions

View File

@ -566,7 +566,7 @@ class CurlDownloader
}
$details = '';
if ($response->getHeader('content-type') === 'application/json') {
if (in_array(strtolower($response->getHeader('content-type')), array('application/json', 'application/json; charset=utf-8'), true)) {
$details = ':'.PHP_EOL.substr($response->getBody(), 0, 200).(strlen($response->getBody()) > 200 ? '...' : '');
}