CORE-4788: changed the way that the redirection URL is determined in AsyncCallbackWrapper