private function RedirectMiddleware::guardMax in Lockr 7.3
1 call to RedirectMiddleware::guardMax()
- RedirectMiddleware::checkRedirect in vendor/
guzzlehttp/ guzzle/ src/ RedirectMiddleware.php
File
- vendor/
guzzlehttp/ guzzle/ src/ RedirectMiddleware.php, line 138
Class
- RedirectMiddleware
- Request redirect middleware.
Namespace
GuzzleHttpCode
private function guardMax(RequestInterface $request, array &$options) {
$current = isset($options['__redirect_count']) ? $options['__redirect_count'] : 0;
$options['__redirect_count'] = $current + 1;
$max = $options['allow_redirects']['max'];
if ($options['__redirect_count'] > $max) {
throw new TooManyRedirectsException("Will not follow more than {$max} redirects", $request);
}
}