private function checkNumberRedirects($url)
    {
        ++self::$nbRedirect;

        // keep initial url in case of endless redirect
        if ('' === self::$initialUrl) {
            self::$initialUrl = $url;
        }

        if (self::$nbRedirect > $this->config['max_redirect']) {
            $this->logger->warning('Endless redirect: ' . self::$nbRedirect . ' on "{url}"', ['url' => $url]);

            return false;
        }

        return true;
    }