'Add X-Forwarded-For header if the request doesn\'t have one'

def modify_request(self, request):

    if (not request.has_header('X-forwarded-for')):
        request.add_header('X-forwarded-for', self.get_random_ip())
    return request
