Unparses a {PostmanUrl} into a string.

@param {Boolean=} forceProtocol - Forces the URL to have a protocol
@returns {string}
160986
function (forceProtocol) {
        var rawUrl = E,
            protocol = this.protocol;

        forceProtocol && !protocol && (protocol = DEFAULT_PROTOCOL);

        if (protocol) {
            rawUrl += (_.endsWith(protocol, PROTOCOL_SEPARATOR) ? protocol : protocol + PROTOCOL_SEPARATOR);
        }

        if (this.auth && this.auth.user) { // If the user is not specified, ignore the password.
            rawUrl = rawUrl + ((this.auth.password) ?
                // ==> username:password@
                this.auth.user + AUTH_SEPARATOR + this.auth.password : this.auth.user) + AUTH_CREDENTIALS_SEPARATOR;
        }

        if (this.host) {
            rawUrl += this.getHost();
        }

        if (this.port) {
            rawUrl += PORT_SEPARATOR + this.port.toString();
        }

        if (this.path) {
            rawUrl += this.getPath();
        }

        if (this.query && this.query.count()) {
            rawUrl += QUERY_SEPARATOR + this.getQueryString({ ignoreDisabled: true });
        }

        if (this.hash) {
            rawUrl += SEARCH_SEPARATOR + this.hash;
        }

        return rawUrl;
    }
137144
def detachAcceptMsOriginating():
    """"""
    a = TpPd(pd=0x3)
    b = MessageType(mesType=0x6)  # 00000110
    c = ForceToStandbyAndSpareHalfOctets()
    packet = a / b / c
    return packet
193935
function (url) {
        url = _.trimStart(url);
        var pathVariables,
            p = {
                raw: url
            };

        // extract the protocol
        p.protocol = _.get(url.match(regexes.extractProtocol), GET_1);
        _.isString(p.protocol) && (url = url.substr(p.protocol.length + 3)); // remove that damn protocol from url

        // extract the host
        p.host = _.get(url.match(regexes.extractHost), GET_1);

        // if host exists there are a lot you can extract from it
        if (_.isString(p.host)) {
            url = url.substr(p.host.length); // remove host from url

            if ((p.auth = _.get(p.host.match(regexes.extractHostAuth), GET_1))) {
                p.host = p.host.substr(p.auth.length + 1); // remove auth from host
                p.auth = p.auth.split(AUTH_SEPARATOR);
                p.auth = {
                    user: p.auth[0],
                    password: p.auth[1]
                };
            }

            // extract the port from the host
            p.port = _.get(p.host.match(regexes.extractPort), GET_1);
            p.port && (p.host = p.host.substring(0, p.host.length - p.port.length - 1)); // remove port from url

            p.host = _.trim(p.host, DOMAIN_SEPARATOR).split(regexes.splitDomain); // split host by subdomains
        }

        // extract the path
        p.path = _.get(url.match(regexes.extractPath), GET_0);
        if (_.isString(p.path)) {
            url = url.substr(p.path.length);
            p.path && (p.path = p.path.replace(regexes.trimPath, MATCH_1)); // remove leading slash for valid path
            // if path is blank string, we set it to undefined, if '/' then single blank string array
            p.path = p.path ? (p.path === PATH_SEPARATOR ? [E] : p.path.split(PATH_SEPARATOR)) : undefined;
        }

        // extract the query string
        p.query = _.get(url.match(regexes.extractQuery), GET_1);
        _.isString(p.query) && ((url = url.substr(p.query.length + 1)), (p.query = QueryParam.parse(p.query)));

        // extract the hash
        p.hash = _.get(url.match(regexes.extractSearch), GET_1);

        // extract path variables
        pathVariables = _.transform(p.path, function (res, segment) {
            // check if the segment has path variable prefix followed by the variable name.
            if (_.startsWith(segment, PATH_VARIABLE_IDENTIFIER) && segment !== PATH_VARIABLE_IDENTIFIER) {
                res.push({ key: segment.slice(1) }); // remove path variable prefix.
            }
        }, []);
        p.variable = pathVariables.length ? pathVariables : undefined;

        return p;
    }
921548
function parseURL(url) {

	const endpoint = {};

	const purl = urlParser.parse(url, true);

	if (purl.protocol && purl.protocol.startsWith('http')) {
		endpoint.protocol = purl.protocol.slice(0, -1);
		if (purl.hostname) {
			endpoint.hostname = purl.hostname;

			if (purl.port) {
				endpoint.port = parseInt(purl.port);
			}

		} else {
			throw new Error('InvalidURL: missing hostname.');
		}

	} else {
		throw new Error('InvalidURL: url must start with http or https.');
	}

	return endpoint;
}
1045675
@Override
  public String getProtocol(HttpServletRequest request) {
    String proto = request.getHeader(X_FORWARED_PROTO);
    if( proto != null ) return proto;
    return super.getProtocol(request);
  }
1125193
function urlFromHttpRequestOptions(options, protocol) {
  var parsedPath = options.path.split('?');
  var pathname = parsedPath.shift();
  var search = parsedPath.join('?');

  var urlOptions = {
    protocol: protocol,
    hostname: options.hostname || options.host,
    auth: options.auth,
    port: options.port,
    pathname: pathname,
    search: search
  };

  return url.format(urlOptions);
}
389932
function proxyOptsFromStr(str) {
    if (!str) {
        return (false);
    }

    var s = str;

    // Normalize: host:port -> http://host:port
    // FWIW `curl` supports using "http_proxy=host:port".
    if (!/^[a-z0-9]+:\/\//.test(s)) {
        s = 'http://' + s;
    }
    var parsed = url.parse(s);

    var proxyOpts = {
        protocol: parsed.protocol,
        host: parsed.hostname
    };

    if (parsed.port) {
        proxyOpts.port = Number(parsed.port);
    }

    if (parsed.auth) {
        proxyOpts.proxyAuth = parsed.auth;
    }

    return (proxyOpts);
}
182097
function breakableUrl(url) {
        // This is for displaying in UI, so always want it escaped
        var escUrl = _.escape(url);

        // Inject zero-width space character (U+200B) near path separators (/) to allow line breaking there
        return escUrl.replace(
            new RegExp(regexEscape("/"), "g"),
            "/" + "&#8203;"
        );
    }
6332
protected String getProtocolByHttpContentType(HttpServletRequest httpServletRequest) {
        if (StringUtil.isEmpty(httpServletRequest.getContentType())) {
            throw new InvalidRequestException("Rpc protocol invalid");
        }
        String protocol = httpServletRequest.getContentType().split(";")[0];
        if (protocol == null) {
            protocol = NaviCommonConstant.DEFAULT_PROTOCAL_CONTENT_TYPE;
            if (LOG.isDebugEnabled()) {
                LOG.debug("Content-type set to default value "
                        + NaviCommonConstant.DEFAULT_PROTOCAL_CONTENT_TYPE);
            }
        } else {
            protocol = protocol.toLowerCase();
        }
        return protocol;
    }
394755
public static String getProtocol(String url)
  {
    if(url == null) {
      return null;
    }
    int protocolSeparatorIndex = url.indexOf("://");
    if(protocolSeparatorIndex == -1) {
      return null;
    }
    return url.substring(0, protocolSeparatorIndex).toLowerCase();
  }
806670
private String forceResolve(String key) {
        GetParametersRequest request;

        if (key.startsWith("aws.")) {
            log.warn("Will not try to resolve unprefixed key (" + key + ") - AWS does not allow this");
            if (org.apache.commons.lang3.StringUtils.isNotEmpty(parameterPrefix)) {
                request = new GetParametersRequest().withNames(parameterPrefix + key).withWithDecryption(true);
            } else {
                return null;
            }
        } else {
            request = new GetParametersRequest().withNames(parameterPrefix + key, key).withWithDecryption(true);
        }

        GetParametersResult result = ssmClient.getParameters(request);

        for (Parameter parameter : result.getParameters()) {
            return parameter.getValue();
        }
        return null;
    }
26845
function (options) {
        if (!_.isObject(options)) {
            return;
        }

        var parsedUrl,
            port = _.get(options, 'port') >> 0;

        if (_.isString(options.host)) {
            parsedUrl = nodeUrl.parse(options.host);
            // we want to strip the protocol, but if protocol is not present then parsedUrl.hostname will be null
            this.host = parsedUrl.protocol ? parsedUrl.hostname : options.host;
        }

        _.isString(options.match) && (this.match = new UrlMatchPattern(options.match));
        _.isString(_.get(options, 'match.pattern')) && (this.match = new UrlMatchPattern(options.match.pattern));
        port && (this.port = port);
        _.isBoolean(options.tunnel) && (this.tunnel = options.tunnel);
        // todo: Add update method in parent class Property and call that here
        _.isBoolean(options.disabled) && (this.disabled = options.disabled);
        _.isBoolean(options.authenticate) && (this.authenticate = options.authenticate);
        _.isString(options.username) && (this.username = options.username);
        _.isString(options.password) && (this.password = options.password);
    }
471333
private static String getProtocol(URL url) {
	String p = url.getProtocol().toLowerCase();
	if (p.indexOf('/') == -1) return p;
	if (p.indexOf("https") != -1) return "https";
	if (p.indexOf("http") != -1) return "http";
	return p;
    }
323022
function parse(string) {
  if (!string) {
    throw new TypeError('argument string is required')
  }

  if (typeof string === 'object') {
    // support req/res-like objects as argument
    string = getcontenttype(string)

    if (typeof string !== 'string') {
      throw new TypeError('content-type header is missing from object');
    }
  }

  if (typeof string !== 'string') {
    throw new TypeError('argument string is required to be a string')
  }

  var index = string.indexOf(';')
  var type = index !== -1
    ? string.substr(0, index).trim()
    : string.trim()

  if (!typeRegExp.test(type)) {
    throw new TypeError('invalid media type')
  }

  var key
  var match
  var obj = new ContentType(type.toLowerCase())
  var value

  paramRegExp.lastIndex = index

  while (match = paramRegExp.exec(string)) {
    if (match.index !== index) {
      throw new TypeError('invalid parameter format')
    }

    index += match[0].length
    key = match[1].toLowerCase()
    value = match[2]

    if (value[0] === '"') {
      // remove quotes and escapes
      value = value
        .substr(1, value.length - 2)
        .replace(qescRegExp, '$1')
    }

    obj.parameters[key] = value
  }

  if (index !== -1 && index !== string.length) {
    throw new TypeError('invalid parameter format')
  }

  return obj
}
397929
function parse(pathString) {
    var a = doc.createElement('a');
    a.href = pathString;

    var protocol = a.protocol;
    var domain = a.hostname;
    var port = a.port;
    var path = a.pathname;
    var search = a.search;
    var hash = a.hash;
    var host = a.host;
    var origin = a.origin;
    var dir = reDir.test(path) ? reDir.exec(path)[1] : '';
    var base = reBase.test(path) ? reBase.exec(path)[1] : '';
    var ext = reExt.test(path) ? reExt.exec(path)[1] : '';

    return {
      protocol  : protocol,
      domain    : domain,
      port      : port,
      host      : host,
      origin    : origin,
      path      : path,
      search    : search,
      hash      : hash,
      dir       : dir,
      base      : base,
      ext       : ext
    };
  }
466013
function Request_parse() {
        var that = this, url = this.url;
        if (this.isForwarded) {
            return this._process()
                .then(function destroy() {
                    logger.info('Request.destroy', {
                        url: that.url,
                        status: that.statusCode,
                        id: that.id,
                        isRendered: that.isRendered,
                        content_type: that.getHeader('content-type')
                    });
                    that._destroy();
                })
                .catch(function error(e) {
                    logger.error('Request.destroy', {error: e, url: url});
                });
        }
        // receive body as buffer
        this.request.on('data', this.body.push.bind(this.body));

        return new Promise(this.request.on.bind(this.request, 'end'))
            .then(this._process.bind(this))
            .then(function destroy() {
                logger.info('Request.destroy', {
                    url: that.url,
                    status: that.statusCode,
                    id: that.id,
                    isRendered: that.isRendered,
                    content_type: that.getHeader('content-type')
                });
                that._destroy();
            })
            .catch(function error(e) {
                logger.error('Request.destroy', {error: e, url: url});
            });

    }
754896
function forceStereoAudio(sdp) {
            var sdpLines = sdp.split('\r\n');
            var fmtpLineIndex = null;
            for (var i = 0; i < sdpLines.length; i++) {
                if (sdpLines[i].search('opus/48000') !== -1) {
                    var opusPayload = extractSdp(sdpLines[i], /:(\d+) opus\/48000/i);
                    break;
                }
            }
            for (var i = 0; i < sdpLines.length; i++) {
                if (sdpLines[i].search('a=fmtp') !== -1) {
                    var payload = extractSdp(sdpLines[i], /a=fmtp:(\d+)/);
                    if (payload === opusPayload) {
                        fmtpLineIndex = i;
                        break;
                    }
                }
            }
            if (fmtpLineIndex === null) return sdp;
            sdpLines[fmtpLineIndex] = sdpLines[fmtpLineIndex].concat('; stereo=1; sprop-stereo=1');
            sdp = sdpLines.join('\r\n');
            return sdp;
        }