// 1. Validity of new redirect URL itself
// 2. if redirection is not downgrading security unintentionally
// If it is invalid rethrow the RedirectException to CLI
// for further processing - logging and user communciation
if (isRedirectionInvalid(redirect, connection)) {
throw new RedirectException(ex.getRedirectURLStr(),
"Invalid Redirect. " +
"Security cannot be downgraded. Please try with --secure=false");
}
connection = getConnectionWithRedirectedURL(connection, redirect);
}