Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Commit

Permalink
Handle empty body
Browse files Browse the repository at this point in the history
  • Loading branch information
dz0ny committed Dec 2, 2015
1 parent 6ae1b00 commit eb0928f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vcr/matchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def _transform_json(body):
# Request body is always a byte string, but json.loads() wants a text
# string. RFC 7159 says the default encoding is UTF-8 (although UTF-16
# and UTF-32 are also allowed: hmmmmm).
return json.loads(body.decode('utf-8'))
if body:
return json.loads(body.decode('utf-8'))


_xml_header_checker = _header_checker('text/xml')
Expand Down

0 comments on commit eb0928f

Please sign in to comment.