mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-08 16:53:23 +00:00
Rebase on master
- Cleaned up fix to prevent additional nesting - Added unit test Fixes error: ``` > splits = [p.partition(b"=") for p in request.body.split(b"&")] E AttributeError: 'NoneType' object has no attribute 'split' ```
This commit is contained in:
@@ -82,6 +82,10 @@ def replace_post_data_parameters(request, replacements):
|
||||
3. A callable which accepts (key, value, request) and returns a string
|
||||
value or None.
|
||||
"""
|
||||
if not request.body:
|
||||
# Nothing to replace
|
||||
return request
|
||||
|
||||
replacements = dict(replacements)
|
||||
if request.method == "POST" and not isinstance(request.body, BytesIO):
|
||||
if request.headers.get("Content-Type") == "application/json":
|
||||
|
||||
Reference in New Issue
Block a user