private function getRequestTarget(): string
    {
        switch ($this->requestTargetType) {
            case RequestTargetTypes::ORIGIN_FORM:
                $requestTarget = $this->uri->getPath();

                /** @link https://tools.ietf.org/html/rfc7230#section-5.3.1 */
                if ($requestTarget === null || $requestTarget === '') {
                    $requestTarget = '/';
                }

                if (($queryString = $this->uri->getQueryString()) !== null && $queryString !== '') {
                    $requestTarget .= "?$queryString";
                }

                return $requestTarget;
            case RequestTargetTypes::ABSOLUTE_FORM:
                return (string)$this->uri;
            case RequestTargetTypes::AUTHORITY_FORM:
                return $this->uri->getAuthority(false) ?? '';
            case RequestTargetTypes::ASTERISK_FORM:
                return '*';
            default:
                // Shouldn't happen
                return '';
        }
    }