public function appendOnCondition($middleware, callable $condition, $priority = 0): Server
    {
        if (!is_array($middleware)) {
            $middleware = [$middleware];
        }

        foreach ($middleware as $mw) {
            $this->stack[$priority][] = [$condition, $mw];
        }

        return $this;
    }