src/Leevel/Http/Request.php
public function getHost(): string
    {
        $host = $this->headers->get('X_FORWARDED_HOST', $this->headers->get('HOST', ''));

        if (!$host) {
            $host = $this->server->get('SERVER_NAME', $this->server->get('SERVER_ADDR', ''));
        }

        if (false !== strpos($host, ':')) {
            list($host) = explode(':', $host);
        }

        return $host;
    }
public function getHost(): string
    {
        $host = $this->headers->get('X_FORWARDED_HOST', $this->headers->get('HOST', ''));

        if (!$host) {
            $host = $this->server->get('SERVER_NAME', $this->server->get('SERVER_ADDR', ''));
        }

        if (false !== strpos($host, ':')) {
            list($host) = explode(':', $host);
        }

        return $host;
    }
获取 host.

@return string