Skip to content

Commit

Permalink
Do not strip body before JSON decoding + do not return None on empty …
Browse files Browse the repository at this point in the history
…body (#3482)

This commit actually reverts 6a19364
  • Loading branch information
socketpair committed Jan 4, 2019
1 parent 4c7bc9f commit 298a71a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions aiohttp/client_reqrep.py
Original file line number Diff line number Diff line change
Expand Up @@ -1028,14 +1028,10 @@ async def json(self, *, encoding: str=None,
'unexpected mimetype: %s' % ctype),
headers=self.headers)

stripped = self._body.strip() # type: ignore
if not stripped:
return None

if encoding is None:
encoding = self.get_encoding()

return loads(stripped.decode(encoding))
return loads(self._body.decode(encoding))

async def __aenter__(self) -> 'ClientResponse':
return self
Expand Down

0 comments on commit 298a71a

Please sign in to comment.