[DEV-1471] Add 'self' argument to process_request method of middleware.