Skip to content

Commit

Permalink
get param from kwargs in the safe way
Browse files Browse the repository at this point in the history
  • Loading branch information
KissPeter committed Nov 4, 2019
1 parent 2b7c8f5 commit ab5bd18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apifuzzer/fuzzer_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ def transmit(self, **kwargs):
method = method.decode()
kwargs.pop('method')
self.logger.debug('Request url:{}\nRequest method: {}\nRequest headers: {}\nRequest body: {}'.format(
request_url, method, json.dumps(dict(kwargs['headers']), indent=2), kwargs.get('params')))
request_url, method, json.dumps(dict(kwargs.get('headers',{})), indent=2), kwargs.get('params')))
self.report.set_status(Report.PASSED)
self.report.add('request_url', try_b64encode(request_url))
self.report.add('request_method', try_b64encode(method))
self.report.add('request_headers', try_b64encode(kwargs['headers']))
self.report.add('request_headers', try_b64encode(kwargs.get('headers')))
try:
_return = requests.request(method=method, url=request_url, verify=False, timeout=10, **kwargs)
except Exception as e:
Expand Down

0 comments on commit ab5bd18

Please sign in to comment.