Skip to content

Commit fdedb41

Browse files
committed
fix pylint json_mutator
1 parent 018f678 commit fdedb41

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

wapitiCore/mutation/json_mutator.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,29 +49,29 @@ def get_item(json_object, path):
4949
return ptr
5050

5151

52-
class JSONMutator:
52+
class JSONMutator():
5353
"""The JSONMutator will only mutate the JSON object within the body,
5454
it won't change parameters in the query string"""
5555
def __init__(
56-
self, methods="FGP", qs_inject=False, max_queries_per_pattern: int = 1000,
57-
skip=None # Must not attack those parameters (blacklist)
56+
self, _methods="FGP", _qs_inject=False, _max_queries_per_pattern: int = 1000,
57+
_skip=None # Must not attack those parameters (blacklist)
5858
):
5959
self._attack_hashes = set()
6060

61-
def mutate(self,
62-
request: Request,
61+
@staticmethod
62+
def mutate(request: Request,
6363
payloads: PayloadSource) -> Iterator[Tuple[Request, Parameter, PayloadInfo]]:
6464
get_params = request.get_params
6565

6666
referer = request.referer
6767

6868
if not request.is_json:
69-
raise StopIteration
69+
return
7070

7171
try:
7272
data = json.loads(request.post_params)
7373
except json.JSONDecodeError:
74-
raise StopIteration
74+
return
7575

7676
injection_points = find_injectable([], data)
7777

0 commit comments

Comments
 (0)