get site config that matches a specific host + path
@param {string} host
@param {string} path (make sure it starts with a slash!)
@returns {object}
486600
function getSite(host, path) {
  // note: uses the memoized version
  return _.find(module.exports.sites(), function (site) {
    return site.host === host && site.path === path;
  });
}
700125
function resolveConfig(conf, version = '') {
	conf['siteroot'] = conf.baseurl || '/';
	if (version) {
		conf['baseurl'] = path.join(conf.siteroot, version);
	}

	for (let key in conf) {
		if (CONFIG_VAR_REGEX.test(conf[key])) {
			conf[key] = resolve(conf[key], conf, [key]);
		}
	}
	return conf;
}
986800
function(path, full, secure) {
      var root = '';

      if (full) {
        root = app.set('url full');
      } else {
        root = app.set('url prefix');
      }

      // Remove preceding slash if one exists.
      if (path && path[0] === '/') {
        path = path.slice(1);
      }

      if (secure) {
        root =
          undefsafe(config, 'url.ssl.host') || undefsafe(config, 'url.host');
        root = 'https://' + root;
      }

      return path ? root + '/' + path : root;
    }
1111549
function getByRemoteConfig(hostname) {
  var remoteModuleConfig = typeof window !== 'undefined' &&
    window.__fbBatchedBridgeConfig &&
    window.__fbBatchedBridgeConfig.remoteModuleConfig
  if (
    !Array.isArray(remoteModuleConfig) ||
    hostname !== 'localhost' && hostname !== '127.0.0.1'
  ) return { hostname: hostname, passed: false }

  var constants = (
    remoteModuleConfig.find(getConstants) || []
  )[1]
  if (constants) {
    var serverHost = constants.ServerHost || hostname
    return { hostname: serverHost.split(':')[0], passed: true }
  }
  return { hostname: hostname, passed: false }
}
370418
def get_url(self, path):
        
        host = ('[' + self.host + ']' if (self.host.find(':') != -1)
                else self.host)
        base_url = self.protocol + '://' + host + ':' + str(self.port)
        return base_url + '/v3alpha/' + path.lstrip("/")
93317
function(path) {
          /* If the path starts with a protocol+host, store it and remove it (add it
             back later) so we don't accidently modify it. */
          var protocol = path.match(HOST);
          if (protocol) { path = protocol[2]; }

          /* Remove multiple slashes and trivial dots (`/./ -> /`). */
          path = path.replace(/\/+/g, '/').replace(/\/\.\//g, '/');

          /* Loop to collapse instances of `../` in the path by matching a previous
             path segment.  Essentially, we find substrings of the form `/abc/../`
             where abc is not `.` or `..` and replace the substrings with `/`.
             We loop until the string no longer changes since after collapsing
             possible instances once, we may have created more instances that can
             be collapsed.
          */
          var o;
          while((o = path) != (path = path.replace(/(^|\/)(?!\.?\.\/)([^\/]+)\/\.\.\//g, '$1'))) {}
          /* Don't forget to prepend any protocol we might have removed earlier. */
          return protocol ? protocol[1] + path.replace(/^\//, '') : path;
        }
983230
private static boolean exclude(String host, java.nio.file.Path path) {
        List<PathMatcher> exclusions = getExcludes(host);
        if (exclusions == null && host != null) {
            exclusions = getExcludes(null); // check global config
        }
        if (exclusions != null) {
            for (PathMatcher matcher : exclusions) {
                if (matcher.matches(path))
                    return true;
            }
        }
        return false;
    }
797733
function reqURL(req, newPath) {
  return url.format({
    protocol: 'https', //req.protocol, // by default this returns http which gets redirected
    host: req.get('host'),
    pathname: newPath
  })
}
1324816
function get(path, cb) {
        getAgent((agent) => { http.get({ host: host, port: port, path: path, agent: agent}, (response) => {
            var body = ''; response.on('data', (d) => { body += d; });
            response.on('end', (err) => { if(cb) cb(body); });
        }).on('error', function(error) {
            log(`Error on GET ${path} ${error.message}`)
            if (cb) cb('');
        }) });
    }
299066
public static function getHome($path = '',$scheme = '')
	{
		$domain = Config::get('@.DOMAIN');
		if(empty($domain))
		{
			$domain = $_SERVER['HTTP_HOST'] . strtr(dirname($_SERVER['SCRIPT_NAME']), '\\','/');
		}
		if('' === $scheme)
		{
			$scheme = Config::get('@.URL_PROTOCOL');
			if(empty($scheme))
			{
				$scheme=Request::getProtocol();
			}
		}
		if((!isset($path[0]) || '/' !== $path[0]) && '/' !== substr($domain,-1,1))
		{
			$path = '/' . $path;
		}
		return $scheme . $domain . $path;
	}
69232
function getConfigPath(configPaths) {
  let conf = null;

  // Try all config paths and return for the first found one
  some(configPaths, configPath => {
    if (!configPath) return;

    // Compile config using environment variables
    const compiledConfigPath = template(configPath)(process.env);

    let resolvedConfigPath = resolve(process.cwd(), compiledConfigPath);
    const resolvedName = fileExists(resolvedConfigPath);

    if (resolvedConfigPath && resolvedName) {
      conf = resolvedName;
    }

    return conf;
  });

  return conf;
}
595876
function loadConfig(path) {
    var glob = require('glob');
    var object = {};
    var key;

    glob.sync('*', {cwd: path}).forEach(function(option) {
      key = option.replace(/\.js$/,'');
      object[key] = require(path + option);
    });

    return object;
  }
947642
function(path) {
    return (path && path.match(/^[a-z]:\\/i)) ? path.charAt(0).toLowerCase() + path.slice(1) : path;
  }
1122610
function constructHostEntry(xmlElement) {
  var host = {
      scheme: DEFAULT_SCHEME,
      name: '',
      paths: []
    };
  var hostProperties = xmlElement['$'];

  if (hostProperties == null || hostProperties.length == 0) {
    return null;
  }

  // read host name
  host.name = hostProperties.name;

  // read scheme if defined
  if (hostProperties['scheme'] != null) {
    host.scheme = hostProperties.scheme;
  }

  // construct paths list, defined for the given host
  host.paths = constructPaths(xmlElement);

  return host;
}
180977
function (fileName) {
            var dir;
            if (currDirRegExp.test(fileName)) {
                dir = frontSlash(location.href);
                if (dir.indexOf('/') !== -1) {
                    dir = dir.split('/');

                    //Pull off protocol and host, just want
                    //to allow paths (other build parts, like
                    //require._isSupportedBuildUrl do not support
                    //full URLs), but a full path from
                    //the root.
                    dir.splice(0, 3);

                    dir.pop();
                    dir = '/' + dir.join('/');
                }

                fileName = dir + fileName.substring(1);
            }

            return fileName;
        }
982584
function matchesPath(requestedUrl, opts) {
  var paths = !opts.path || Array.isArray(opts.path) ?
    opts.path : [opts.path];

  if (paths) {
    return paths.some(function(p) {
      return (typeof p === 'string' && p === requestedUrl.pathname) ||
        (p instanceof RegExp && !! p.exec(requestedUrl.pathname));
    });
  }

  return false;
}
1055831
function getPathHostName(origin, path) {
  const pathOverride = {
    '/oauth/userinfo': `https://${origin}.battle.net`,
  };

  return Object.prototype.hasOwnProperty.call(pathOverride, path) ? pathOverride[path] : endpoints[origin].hostname;
}