Also output headers
parent
8030fbc4ae
commit
e8a3a33023
|
@ -305,15 +305,15 @@ class CurlDownloader
|
||||||
}
|
}
|
||||||
throw new TransportException('curl error '.$errno.' while downloading '.Url::sanitize($progress['url']).': '.$error);
|
throw new TransportException('curl error '.$errno.' while downloading '.Url::sanitize($progress['url']).': '.$error);
|
||||||
}
|
}
|
||||||
if ($progress['http_code'] === 0) {
|
|
||||||
throw new \LogicException('Received unexpected http status code 0 without error for '.Url::sanitize($progress['url']).': '.var_export($progress, true));
|
|
||||||
}
|
|
||||||
|
|
||||||
$statusCode = $progress['http_code'];
|
$statusCode = $progress['http_code'];
|
||||||
rewind($job['headerHandle']);
|
rewind($job['headerHandle']);
|
||||||
$headers = explode("\r\n", rtrim(stream_get_contents($job['headerHandle'])));
|
$headers = explode("\r\n", rtrim(stream_get_contents($job['headerHandle'])));
|
||||||
fclose($job['headerHandle']);
|
fclose($job['headerHandle']);
|
||||||
|
|
||||||
|
if ($statusCode === 0) {
|
||||||
|
throw new \LogicException('Received unexpected http status code 0 without error for '.Url::sanitize($progress['url']).': headers '.var_export($headers, true).' curl info '.var_export($progress, true));
|
||||||
|
}
|
||||||
|
|
||||||
// prepare response object
|
// prepare response object
|
||||||
if ($job['filename']) {
|
if ($job['filename']) {
|
||||||
$contents = $job['filename'].'~';
|
$contents = $job['filename'].'~';
|
||||||
|
|
Loading…
Reference in New Issue