You are here

private function RedirectMiddleware::guardMax in Auth0 Single Sign On 8.2

Check for too many redirects

Return value

void

Throws

TooManyRedirectsException Too many redirects.

1 call to RedirectMiddleware::guardMax()
RedirectMiddleware::checkRedirect in vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php

File

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

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