Fix handling of json error responses
parent
cb1e248258
commit
1e3f7cfcba
|
@ -566,7 +566,7 @@ class CurlDownloader
|
||||||
}
|
}
|
||||||
|
|
||||||
$details = '';
|
$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 ? '...' : '');
|
$details = ':'.PHP_EOL.substr($response->getBody(), 0, 200).(strlen($response->getBody()) > 200 ? '...' : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue