protected function hasBasicAuthPrompt(HTTPResponse $response = null)
    {
        if (!$response) {
            return false;
        }
        return ($response->getStatusCode() === 401 && $response->getHeader('WWW-Authenticate'));
    }