From 3493529879c4d255e587c0181ed62ef9b87f9d1e Mon Sep 17 00:00:00 2001 From: noO0oOo0ob <38344038+noO0oOo0ob@users.noreply.github.com> Date: Fri, 1 Dec 2023 14:16:07 +0800 Subject: [PATCH] make sure flow type is HookedDict when match rule (#804) --- lyrebird/mock/handlers/function_executor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lyrebird/mock/handlers/function_executor.py b/lyrebird/mock/handlers/function_executor.py index 879780137..6e80688c5 100644 --- a/lyrebird/mock/handlers/function_executor.py +++ b/lyrebird/mock/handlers/function_executor.py @@ -1,6 +1,7 @@ import re import traceback from lyrebird.log import get_logger +from lyrebird.utils import HookedDict logger = get_logger() @@ -28,6 +29,8 @@ def func_handler(func_list, flow, handler_type='flow_editor'): @staticmethod def get_matched_sorted_handler(func_list, flow): matched_func = [] + if not isinstance(flow, HookedDict): + flow = HookedDict(flow) for func in func_list: rules = func['rules'] if not rules or FunctionExecutor._is_req_match_rule(rules, flow):