private function handleRedirect(array $job, Response $response)
private function handleRedirect(array $job, Response $response, array $responseInfo)
{
{
if ($locationHeader = $response->getHeader('location')) {
if ($locationHeader = $response->getHeader('location')) {
if (parse_url($locationHeader, PHP_URL_SCHEME)) {
if (parse_url($locationHeader, PHP_URL_SCHEME)) {
@ -445,10 +445,12 @@ class CurlDownloader
return $targetUrl;
return $targetUrl;
}
}
throw new TransportException('The "'.$job['url'].'" file could not be downloaded, got redirect without Location ('.$response->getStatusMessage().')');
$exception = new TransportException('The "'.$job['url'].'" file could not be downloaded, got redirect without Location ('.$response->getStatusMessage().')');
$exception->setResponseInfo($responseInfo);
throw $exception;
}
}
private function isAuthenticatedRetryNeeded(array $job, Response $response)
private function isAuthenticatedRetryNeeded(array $job, Response $response, array $responseInfo)
{
{
if (in_array($response->getStatusCode(), array(401, 403)) && $job['attributes']['retryAuthFailure']) {
if (in_array($response->getStatusCode(), array(401, 403)) && $job['attributes']['retryAuthFailure']) {