mirror of https://github.com/MISP/PyMISP
fix: Print the full json blob in debug mode
Related https://github.com/MISP/PyMISP/issues/462pull/500/head
parent
b1e50c8f6d
commit
cd2995a212
|
@ -2193,10 +2193,6 @@ class ExpandedPyMISP(PyMISP):
|
|||
kw_params: dict={}, output_type: str='json'):
|
||||
'''Prepare a request for python-requests'''
|
||||
url = urljoin(self.root_url, url)
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
logger.debug(f'{request_type} - {url}')
|
||||
if data is not None:
|
||||
logger.debug(data)
|
||||
if data:
|
||||
if not isinstance(data, str): # Else, we already have a text blob to send
|
||||
if isinstance(data, dict): # Else, we can directly json encode.
|
||||
|
@ -2204,6 +2200,11 @@ class ExpandedPyMISP(PyMISP):
|
|||
data = {k: v for k, v in data.items() if v is not None}
|
||||
data = json.dumps(data, default=pymisp_json_default)
|
||||
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
logger.debug(f'{request_type} - {url}')
|
||||
if data is not None:
|
||||
logger.debug(data)
|
||||
|
||||
if kw_params:
|
||||
# CakePHP params in URL
|
||||
to_append_url = '/'.join([f'{k}:{v}' for k, v in kw_params.items()])
|
||||
|
|
Loading…
Reference in New Issue