public function getHost(): string
    {
        if (!isset($this->segments['host'])) {
            throw new UrlException('Unable to get host for ' . $this->url);
        }

        return $this->segments['host'];
    }