protected function getMiddlewareHandlers(\Owl\Http\Request $request)
    {
        if (!$this->middleware_handlers) {
            return [];
        }

        $request_path = $this->getRequestPath($request);

        $result = [];
        foreach ($this->middleware_handlers as $path => $handlers) {
            if (strpos($request_path, $path) === 0) {
                $result = array_merge($result, $handlers);
            }
        }

        return $result;
    }