public function hasRoute(ServerRequestInterface $request, $withMethod = true)
    {
        $route = $this->findRoute($request->getUri(), $withMethod ? $request->getMethod() : null);
        return isset($route);
    }