protected String fixSchemeIfNeeded()

in struts2-custom-results-plugin/src/main/java/org/apache/struts2/result/SslOffloadAwareServletRedirectResult.java [140:157]


    protected String fixSchemeIfNeeded(String location, HttpServletRequest request) {
        if (shouldFixScheme(request)) {
            LOG.debug("https offloading happened, fixing redirectlocation");
            StringBuilder fixedLocation = new StringBuilder();
            fixedLocation.append("https");
            fixedLocation.append("://");
            fixedLocation.append(request.getServerName());
            if (request.getServerPort() != 80) {
                fixedLocation.append(':');
                fixedLocation.append(request.getServerPort());
            }
            fixedLocation.append(location);

            return fixedLocation.toString();
        } else {
            return location;
        }
    }