mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-08 16:53:23 +00:00
Make json.loads of Python >=3.6 decode bytes by itself
Quoting https://docs.python.org/3/library/json.html#json.loads : > Changed in version 3.6: s can now be of type bytes or bytearray. > The input encoding should be UTF-8, UTF-16 or UTF-32.
This commit is contained in:
@@ -95,7 +95,7 @@ def replace_post_data_parameters(request, replacements):
|
||||
new_body[k] = rv
|
||||
request.body = new_body
|
||||
elif request.headers.get("Content-Type") == "application/json":
|
||||
json_data = json.loads(request.body.decode("utf-8"))
|
||||
json_data = json.loads(request.body)
|
||||
for k, rv in replacements.items():
|
||||
if k in json_data:
|
||||
ov = json_data.pop(k)
|
||||
|
||||
Reference in New Issue
Block a user