The canonical ServerName of the server serving the request. (%v)
17985
public static function getHost(ServerRequestInterface $request): string
    {
        $host = $request->hasHeader('Host') ? $request->getHeaderLine('Host') : $request->getUri()->getHost();

        return $host ?: '-';
    }
736283
private static String generateTempServerName() {
        String serverName = TEMP_SERVER_NAME;

        while (InstallUtils.serverExists(serverName)) {

            int randomNumber = random.nextInt();

            while (randomNumber == Integer.MIN_VALUE) {
                randomNumber = random.nextInt();
            }

            serverName = TEMP_SERVER_NAME + "_" + Integer.toString(Math.abs(randomNumber));
        }

        return serverName;
    }
285878
public static String rehostLocation (
        HttpServletRequest req, String servername)
    {
        StringBuffer buf = req.getRequestURL();
        String csname = req.getServerName();
        int csidx = buf.indexOf(csname);
        if (csidx != -1) {
            buf.delete(csidx, csidx + csname.length());
            buf.insert(csidx, servername);
        }
        String query = req.getQueryString();
        if (!StringUtil.isBlank(query)) {
            buf.append("?").append(query);
        }
        return buf.toString();
    }
450290
def get_canonical_host(self):
        
        host = self.host.lower()
        if self.port is not None:
            host = "%s:%s" % (host, self.port)
        return host
960112
def get_self_host(request_data):
        
        if 'http_host' in request_data:
            current_host = request_data['http_host']
        elif 'server_name' in request_data:
            current_host = request_data['server_name']
        else:
            raise Exception('No hostname defined')

        if ':' in current_host:
            current_host_data = current_host.split(':')
            possible_port = current_host_data[-1]
            try:
                possible_port = float(possible_port)
                current_host = current_host_data[0]
            except ValueError:
                current_host = ':'.join(current_host_data)

        return current_host
1333790
public function guessRequestCanonicalUri()
    {
        $server = $this->ns(INPUT_SERVER);
        
        // Determine if the request was over SSL (HTTPS).
        if( (strtolower($server->getValue('HTTPS','off')) != 'off')) {
            $schema = 'https://';
            $defaultPort=443;
        } else {
            $schema = 'http://';
            $defaultPort=80;           
        }
        
        $port = ($server->getValue('SERVER_PORT',$defaultPort, ContextNameSpace::NON_NEGATIVE_INT()));
        $http_host = $server->getValue('HTTP_HOST','localhost');        
        $authority = ($port===$defaultPort)
            ?($http_host)
            :($http_host . ':'. $port);
                
        return $schema.$authority.$this->guessRequestRelativeUri();
    }
531514
private String getHostHeaderForHost(String hostName) {
        List<ServerRedirect> servers = serverRedirectService.tableServers(requestInformation.get().client.getId());
        for (ServerRedirect server : servers) {
            if (server.getSrcUrl().compareTo(hostName) == 0) {
                String hostHeader = server.getHostHeader();
                if (hostHeader == null || hostHeader.length() == 0) {
                    return null;
                }
                return hostHeader;
            }
        }
        return null;
    }
841559
private function _hostname()
    {
        if (PSI_USE_VHOST === true) {
            if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
        } else {
            if (CommonFunctions::executeProgram('uname', '-n', $result, PSI_DEBUG)) {
                $ip = gethostbyname($result);
                if ($ip != $result) {
                    $this->sys->setHostname(gethostbyaddr($ip));
                }
            }
        }
    }
955252
def request_server_info(self):
        ''' 

        '''
        if self._server_info is None:
            self._server_info = self._send_request_server_info()
        return self._server_info
608459
public function getServerVersion() : string
    {
        return (is_array($this->apache_info) && array_key_exists('server-version', $this->apache_info))
                ? $this->apache_info['server-version']
                : 'Unknown'
        ;
    }
1091071
function serverFromPathname( pathname ) {
  var hash = crc32(pathname);
  var rng = seed(hash);
  var server = 'i' + Math.floor(rng() * 3);
  debug('determined server "%s" to use with "%s"', server, pathname);
  return server + '.wp.com';
}
852968
@Override
    public String getVirtualHostName() {
        if (this.isNonSecurePortEnabled()) {
            return configInstance.getStringProperty(namespace + VIRTUAL_HOSTNAME_KEY,
                    super.getVirtualHostName()).get();
        } else {
            return null;
        }
    }
4778
@Override
    public String getServerName() {
        String name = this.request.getVirtualHost();
        if (null == name) {
            name = "localhost";
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "getServerName: " + name);
        }
        return name;
    }
340012
private String getServerIdVar()
  {
    String serverId = config().get("server.id");

    if (serverId == null) {
      int port = portServer();

      if (port > 0) { // && ! _serverConfig.isEphemeral()) {) {
        serverId = "embed-" + port;
      }
      else {
        serverId = "embed";
      }
    }

    return serverId;
  }
584039
protected function serverHostname()
    {
        $result = 'localhost.localdomain';
        if (!empty($this->Hostname)) {
            $result = $this->Hostname;
        } elseif (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER) and !empty($_SERVER['SERVER_NAME'])) {
            $result = $_SERVER['SERVER_NAME'];
        } elseif (function_exists('gethostname') && gethostname() !== false) {
            $result = gethostname();
        } elseif (php_uname('n') !== false) {
            $result = php_uname('n');
        }
        return $result;
    }
619389
private String getServerName (String osgiName) throws BadServerException {
		String result = osgiName;
		if (null == result) {
			if (registeredServers.isEmpty()) { // wait for the first one
				haveDefaultProviders = true; // only allow one server
				result = FIRST_SERVER;
			} else
			if (registeredServers.size() == 1) { // use the only one
				haveDefaultProviders = true; // only allow one server
				result = registeredServers.keySet().iterator().next();
			} else {
				throw new BadServerException();
			}
		}
		return result;
	}
737195
public static String getLocalHostName() {
        String localHostName = NetUtils.getHostName();
        return SystemPropertiesUtils.getSystemProperty(
                NaviCommonConstant.SYSTEM_PROPERTY_SERVER_HOST_FROM_ENV_4JPAAS2, localHostName);
    }