You are here

private function RedirectMiddleware::guardMax in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php \GuzzleHttp\RedirectMiddleware::guardMax()
1 call to RedirectMiddleware::guardMax()
RedirectMiddleware::checkRedirect in vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php

File

vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php, line 132

Class

RedirectMiddleware
Request redirect middleware.

Namespace

GuzzleHttp

Code

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);
  }
}