private function getUrl($request) : string
    {
        if ($this->urlFormat === RouteMode::PATH_FORMAT) {
            return $request->getUri()->getPath();
        }

        $queryParams = $request->getQueryParams();
        $route       = '';

        if (isset($queryParams[$this->modeRewriteParameter])) {
            $route = $queryParams[$this->modeRewriteParameter];
        }

        $path = '/'.$route;

        return $path;
    }