dist/hawtio-utilities.js
function useProxyIfExternal(connectUrl) {
        if (Core.isChromeApp()) {
            return connectUrl;
        }
        var host = window.location.host;
        if (!_.startsWith(connectUrl, "http://" + host + "/") && !_.startsWith(connectUrl, "https://" + host + "/")) {
            // lets remove the http stuff
            var idx = connectUrl.indexOf("://");
            if (idx > 0) {
                connectUrl = connectUrl.substring(idx + 3);
            }
            // lets replace the : with a /
            connectUrl = connectUrl.replace(":", "/");
            connectUrl = Core.trimLeading(connectUrl, "/");
            connectUrl = Core.trimTrailing(connectUrl, "/");
            connectUrl = Core.url("/proxy/" + connectUrl);
        }
        return connectUrl;
    }
function useProxyIfExternal(connectUrl) {
        if (Core.isChromeApp()) {
            return connectUrl;
        }
        var host = window.location.host;
        if (!_.startsWith(connectUrl, "http://" + host + "/") && !_.startsWith(connectUrl, "https://" + host + "/")) {
            // lets remove the http stuff
            var idx = connectUrl.indexOf("://");
            if (idx > 0) {
                connectUrl = connectUrl.substring(idx + 3);
            }
            // lets replace the : with a /
            connectUrl = connectUrl.replace(":", "/");
            connectUrl = Core.trimLeading(connectUrl, "/");
            connectUrl = Core.trimTrailing(connectUrl, "/");
            connectUrl = Core.url("/proxy/" + connectUrl);
        }
        return connectUrl;
    }
function useProxyIfExternal ( connectUrl ) { if ( Core . isChromeApp ( ) ) { return connectUrl ; } var host = window . location . host ; if ( ! _ . startsWith ( connectUrl , "http://" + host + "/" ) && ! _ . startsWith ( connectUrl , "https://" + host + "/" ) ) { // lets remove the http stuff var idx = connectUrl . indexOf ( "://" ) ; if ( idx > 0 ) { connectUrl = connectUrl . substring ( idx + 3 ) ; } // lets replace the : with a / connectUrl = connectUrl . replace ( ":" , "/" ) ; connectUrl = Core . trimLeading ( connectUrl , "/" ) ; connectUrl = Core . trimTrailing ( connectUrl , "/" ) ; connectUrl = Core . url ( "/proxy/" + connectUrl ) ; } return connectUrl ; }
If a URL is external to the current web application, then
replace the URL with the proxy servlet URL
@method useProxyIfExternal
@for Core
@static
@param {String} connectUrl
@return {String}
If a URL is external to the current web application then replace the URL with the proxy servlet URL