if (\
strpos((string) $response->
getStatusCode(), '3'
) !== 0
|| !
$response->
hasHeader('Location'
) ) { return $response;
} $this->
guardMax($request,
$response,
$options);
$nextRequest =
$this->
modifyRequest($request,
$options,
$response);
// If authorization is handled by curl, unset it if URI is cross-origin.
if (Psr7\UriComparator::
isCrossOrigin($request->
getUri(),
$nextRequest->
getUri()) &&
defined('\CURLOPT_HTTPAUTH'
)) { unset( $options['curl'
][\CURLOPT_HTTPAUTH
],
$options['curl'
][\CURLOPT_USERPWD
] );
} if (isset($options['allow_redirects'
]['on_redirect'
])) { ($options['allow_redirects'
]['on_redirect'
])( $request,
$response,
$nextRequest->
getUri() );