blueocean-dashboard/src/main/js/creation/github/api/GithubApiUtils.js
function extractProtocolHost(url) {
    const urlNoQuery = url.split('?')[0];
    const [protocol, hostAndPath] = urlNoQuery.split('//');
    const host = hostAndPath.split('/')[0];
    return `${protocol}//${host}`;
}
function extractProtocolHost(url) {
    const urlNoQuery = url.split('?')[0];
    const [protocol, hostAndPath] = urlNoQuery.split('//');
    const host = hostAndPath.split('/')[0];
    return `${protocol}//${host}`;
}
function extractProtocolHost ( url ) { const urlNoQuery = url . split ( '?' ) [ 0 ] ; const [ protocol , hostAndPath ] = urlNoQuery . split ( '//' ) ; const host = hostAndPath . split ( '/' ) [ 0 ] ; return ` ${ protocol } ${ host } ` ; }
Extract the protocol and host from a URL.
Will not include the trailing slash.

@param url
@returns {string}
Extract the protocol and host from a URL . Will not include the trailing slash .