'Performs digest authentication on the given HTTP request
handler.  Returns True if authentication was successful, False
otherwise.
If no users have been set, then digest auth is effectively
disabled and this method will always return True.'

def handle_request(self, request_handler):

    if (len(self._users) == 0):
        return True
    if ('Proxy-Authorization' not in request_handler.headers):
        return self._return_auth_challenge(request_handler)
    else:
        auth_dict = self._create_auth_dict(request_handler.headers['Proxy-Authorization'])
        if (auth_dict['username'] in self._users):
            password = self._users[auth_dict['username']]
        else:
            return self._return_auth_challenge(request_handler)
        if (not (auth_dict.get('nonce') in self._nonces)):
            return self._return_auth_challenge(request_handler)
        else:
            self._nonces.remove(auth_dict['nonce'])
        auth_validated = False
        for path in [request_handler.path, request_handler.short_path]:
            if self._validate_auth(auth_dict, password, request_handler.command, path):
                auth_validated = True
        if (not auth_validated):
            return self._return_auth_challenge(request_handler)
        return True
