Skip to content

Commit

Permalink
Merge pull request #517 from glensc/patch-1
Browse files Browse the repository at this point in the history
Skip empty body decode/encode in normalize_json_body
  • Loading branch information
JWCook committed Feb 3, 2022
2 parents 6faa065 + 9f95928 commit aafc42f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions requests_cache/cache_keys.py
Expand Up @@ -161,6 +161,10 @@ def normalize_json_body(
original_body: Union[str, bytes], ignored_parameters: ParamList
) -> Union[str, bytes]:
"""Normalize and filter a request body with serialized JSON data"""

if len(original_body) == 0:
return original_body

try:
body = json.loads(decode(original_body))
body = filter_sort_dict(body, ignored_parameters)
Expand Down

0 comments on commit aafc42f

Please sign in to comment.