private boolean isRedirectable(boolean followRedirect, int statusCode,
                                   String location, String urlOrig) {
        if (followRedirect) {
            if (statusCode >= 300 && statusCode <= 399) {
                if (!location.isEmpty()) {
                    String fullLocation = "";
                    try {
                        fullLocation = UrlUtils.normalizeUrl(urlOrig, location);
                        if (UrlUtils.isValidUrl(fullLocation)) {
                            return true;
                        }
                    } catch (MalformedURLException e) {
                        // do nothing
                    }
                }
            }
        }
        return false;
    }