From 7950b7939fcaae3a0be955459d131e57d87b0b41 Mon Sep 17 00:00:00 2001 From: fanhe Date: Fri, 20 May 2022 16:06:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8Dwebhook?= =?UTF-8?q?=5Fevent=5Fhandler=20=E5=A4=84=E7=90=86response=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- arkid/core/event.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arkid/core/event.py b/arkid/core/event.py index 6f70b6f91..ee01688b9 100644 --- a/arkid/core/event.py +++ b/arkid/core/event.py @@ -33,16 +33,18 @@ def get_event_payload(event): request = None response = None - if event.request: + if event.request and isinstance(event.request, HttpRequest): request = { "body": str(event.request.body, encoding='utf-8'), } - if event.response: + if event.response and isinstance(event.response, HttpResponse): response = { "body": str(event.response.body, encoding='utf-8'), "status_code": event.response.status_code, } + elif type(event.response) is dict: + response = event.response payload = { "tag": event.tag, "tenant": event.tenant.id.hex,