From 1d0f88264f5a531b2dd5b462712cee160874afab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=9E=E6=B3=95=E6=93=8D=E4=BD=9C?= Date: Wed, 15 May 2024 11:05:46 +0800 Subject: [PATCH] Fix HTTP REQUEST NODE is always waiting but endpoint have responsed (#4395) --- api/core/workflow/nodes/http_request/http_executor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/core/workflow/nodes/http_request/http_executor.py b/api/core/workflow/nodes/http_request/http_executor.py index 97cb59d02d0562..2aa79f51aced22 100644 --- a/api/core/workflow/nodes/http_request/http_executor.py +++ b/api/core/workflow/nodes/http_request/http_executor.py @@ -25,7 +25,10 @@ class HttpExecutorResponse: response: Union[httpx.Response, requests.Response] def __init__(self, response: Union[httpx.Response, requests.Response] = None): - self.headers = response.headers + self.headers = {} + if isinstance(response, httpx.Response | requests.Response): + for k, v in response.headers.items(): + self.headers[k] = v self.response = response @property