public function uri(): HttpUri
    {
        $host = (string) $this->headers->value('HTTP_HOST')->value();
        return HttpUri::fromParts(
                $this->headers->contain('HTTPS') ? Http::SCHEME_SSL : Http::SCHEME,
                $host,
                strstr($host, ':') === false ? $this->headers->value('SERVER_PORT')->value() : null,
                (string) $this->headers->value('REQUEST_URI')->value() // already contains query string
        );
    }