Skip to content

Commit

Permalink
aiohttp response body check none fix
Browse files Browse the repository at this point in the history
  • Loading branch information
p1c2u committed Sep 20, 2023
1 parent 37bfb36 commit 9d189e1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions openapi_core/contrib/aiohttp/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ def __init__(self, response: web.Response):

@property
def data(self) -> str:
if self.response.body is None:
return ""

Check warning on line 18 in openapi_core/contrib/aiohttp/responses.py

View check run for this annotation

Codecov / codecov/patch

openapi_core/contrib/aiohttp/responses.py#L18

Added line #L18 was not covered by tests
if isinstance(self.response.body, bytes):
return self.response.body.decode("utf-8")
assert isinstance(self.response.body, str)
Expand Down

0 comments on commit 9d189e1

Please sign in to comment.