Code to handle redirect limits in the async API.