Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions homeassistant/components/cloud/iot.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,6 @@ async def async_handle_webhook(hass, cloud, payload):

response_dict = serialize_response(response)
body = response_dict.get('body')
if body:
body = body.decode('utf-8')

return {
'body': body,
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/util/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ def serialize_response(response: web.Response) -> Dict[str, Any]:
"""Serialize an aiohttp response to a dictionary."""
return {
'status': response.status,
'body': response.body,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a generic helper, we should not change its behavior to make it more shaped for one implementation. If we want that, we should move this function inside the cloud integration.

'body': response.text,
'headers': dict(response.headers),
}