Fix cloud webhook body (#20739)
* Bugfix cloud webhooks text response * address comments * Fix lint
This commit is contained in:
1 parent
94ab5dca7f
commit
cfa03a408e
5 files changed
+40
-35
No files matched your search
@@ -0,0 +1,13 @@
|
||||
"""Helper functions for cloud components."""
|
||||
from typing import Any, Dict
|
||||
|
||||
from aiohttp import web
|
||||
|
||||
|
||||
def aiohttp_serialize_response(response: web.Response) -> Dict[str, Any]:
|
||||
"""Serialize an aiohttp response to a dictionary."""
|
||||
return {
|
||||
'status': response.status,
|
||||
'body': response.text,
|
||||
'headers': dict(response.headers),
|
||||
}
|
||||
Reference in new issue
Block a user