Skip to content

Commit

Permalink
change name (#826)
Browse files Browse the repository at this point in the history
  • Loading branch information
noO0oOo0ob authored Feb 5, 2024
1 parent b4dee9f commit c841bfa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions lyrebird/checker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def json(self):

class DecoratorUtils:
@staticmethod
def modifiy_request_body_decorator(func, modifiy_request_body):
def modify_request_body_decorator(func, modify_request_body):
# When the request modifier modifies only headers or urls,
# ensure that the Origin request body switch is still in effect after the request modifier is triggered
@functools.wraps(func)
Expand All @@ -337,9 +337,9 @@ def wrapper(*args, **kwargs):
if isinstance(args, (list, tuple)) and len(args) > 0 and isinstance(args[0], dict):
if 'keep_origin_request_body' in args[0]:
# When multiple request modifiers are triggered, the original request data is not used as long as one modifies the requestBody
args[0]['keep_origin_request_body'] = args[0]['keep_origin_request_body'] and not modifiy_request_body
args[0]['keep_origin_request_body'] = args[0]['keep_origin_request_body'] and not modify_request_body
else:
args[0]['keep_origin_request_body'] = not modifiy_request_body
args[0]['keep_origin_request_body'] = not modify_request_body
return result
return wrapper

Expand Down
6 changes: 3 additions & 3 deletions lyrebird/checker/on_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class OnRequestHandler:

def __call__(self, rules=None, rank=0, modifiy_request_body=True, *args, **kw):
def __call__(self, rules=None, rank=0, modify_request_body=True, *args, **kw):
def func(origin_func):
func_type = checker.TYPE_ON_REQUEST
if not checker.scripts_tmp_storage.get(func_type):
Expand All @@ -14,14 +14,14 @@ def func(origin_func):
'func': origin_func,
'rules': rules,
'rank': rank if isinstance(rank, (int, float)) else 0,
'modifiy_request_body': modifiy_request_body
'modify_request_body': modify_request_body
})
return origin_func
return func

@staticmethod
def register(func_info):
func_info['func'] = checker.DecoratorUtils.modifiy_request_body_decorator(func_info['func'], func_info['modifiy_request_body'])
func_info['func'] = checker.DecoratorUtils.modify_request_body_decorator(func_info['func'], func_info['modify_request_body'])
application.on_request.append(func_info)

@staticmethod
Expand Down
6 changes: 3 additions & 3 deletions lyrebird/checker/on_request_upstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class OnRequestUpstreamHandler:

def __call__(self, rules=None, rank=0, modifiy_request_body=True, *args, **kw):
def __call__(self, rules=None, rank=0, modify_request_body=True, *args, **kw):
def func(origin_func):
func_type = checker.TYPE_ON_REQUEST_UPSTREAM
if not checker.scripts_tmp_storage.get(func_type):
Expand All @@ -14,14 +14,14 @@ def func(origin_func):
'func': origin_func,
'rules': rules,
'rank': rank if isinstance(rank, (int, float)) else 0,
'modifiy_request_body': modifiy_request_body
'modify_request_body': modify_request_body
})
return origin_func
return func

@staticmethod
def register(func_info):
func_info['func'] = checker.DecoratorUtils.modifiy_request_body_decorator(func_info['func'], func_info['modifiy_request_body'])
func_info['func'] = checker.DecoratorUtils.modify_request_body_decorator(func_info['func'], func_info['modify_request_body'])
application.on_request_upstream.append(func_info)

@staticmethod
Expand Down
4 changes: 2 additions & 2 deletions lyrebird/plugins/plugin_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def print_plugin_api(response):
'func': handler[1],
'rules': handler[2] if len(handler) > 2 else None,
'rank': handler[3] if len(handler) > 3 and isinstance(handler[3], (int, float)) else 0,
'modifiy_request_body': handler[4] if len(handler) > 4 else True
'modify_request_body': handler[4] if len(handler) > 4 else True
})

# Subscribe handler on response
Expand All @@ -114,7 +114,7 @@ def print_plugin_api(response):
'func': handler[1],
'rules': handler[2] if len(handler) > 2 else None,
'rank': handler[3] if len(handler) > 3 and isinstance(handler[3], (int, float)) else 0,
'modifiy_request_body': handler[4] if len(handler) > 4 else True
'modify_request_body': handler[4] if len(handler) > 4 else True
})

# Subscribe handler on proxy response
Expand Down

0 comments on commit c841bfa

Please sign in to comment.