Skip to content

Commit

Permalink
disabled truncating data
Browse files Browse the repository at this point in the history
  • Loading branch information
Iulian Masar committed Aug 9, 2024
1 parent 3da41eb commit f0df0ab
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mangopay/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def custom_request(self, method, url, data=None, idempotency_key=None, oauth_req
params.__delitem__(str("data_XXX"))
headers['Content-Type'] = 'application/x-www-form-urlencoded'

truncated_data = None
# truncated_data = None

encoded_params = urlrequest.urlencode(params)

Expand All @@ -103,16 +103,16 @@ def custom_request(self, method, url, data=None, idempotency_key=None, oauth_req
url = '%s?%s' % (url, encoded_params)

if data or data == {}:
truncated_data = truncatechars(copy.copy(data))
# truncated_data = truncatechars(copy.copy(data))

data = json.dumps(data, default=lambda x: x.to_api_json())

logger.debug('DATA[IN -> %s]\n\t- headers: %s\n\t- content: %s', url, headers, truncated_data)
logger.debug('DATA[IN -> %s]\n\t- headers: %s\n\t- content: %s', url, headers, data)

ts = time.time()

# signal:
request_started.send(url=url, data=truncated_data, headers=headers, method=method)
request_started.send(url=url, data=data, headers=headers, method=method)

try:
result = requests_session.request(method, url,
Expand Down Expand Up @@ -143,7 +143,7 @@ def custom_request(self, method, url, data=None, idempotency_key=None, oauth_req

# signal:
request_finished.send(url=url,
data=truncated_data,
data=data,
headers=headers,
method=method,
result=result,
Expand All @@ -162,7 +162,7 @@ def custom_request(self, method, url, data=None, idempotency_key=None, oauth_req
if result.status_code not in (requests.codes.ok, requests.codes.not_found,
requests.codes.created, requests.codes.accepted,
requests.codes.no_content):
self._create_apierror(result, url=url, data=truncated_data, method=method)
self._create_apierror(result, url=url, data=data, method=method)
elif result.status_code == requests.codes.no_content:
return result, None
else:
Expand Down

0 comments on commit f0df0ab

Please sign in to comment.