Skip to content

Commit

Permalink
[rest] fix aiohttp read in rest (Azure#20952)
Browse files Browse the repository at this point in the history
  • Loading branch information
iscai-msft authored Sep 30, 2021
1 parent 8935901 commit 3a13c9c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sdk/core/azure-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 1.19.0 (Unreleased)
## 1.19.0 (2021-09-30)

### Features Added

Expand Down
12 changes: 12 additions & 0 deletions sdk/core/azure-core/azure/core/rest/_aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,18 @@ def __getstate__(self):
state['headers'] = CIMultiDict(self.headers) # MultiDictProxy is not pickable
return state

async def read(self) -> bytes:
"""Read the response's bytes into memory.
:return: The response's bytes
:rtype: bytes
"""
if not self._content:
self._stream_download_check()
self._content = await self._internal_response.read()
await self._set_read_checks()
return _aiohttp_body_helper(self)

async def close(self) -> None:
"""Close the response.
Expand Down

0 comments on commit 3a13c9c

Please sign in to comment.