Parcourir la source

Fix HTTP REQUEST NODE is always waiting but endpoint have responsed (#4395)

非法操作 il y a 11 mois
Parent
commit
1d0f88264f
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 4 1
      api/core/workflow/nodes/http_request/http_executor.py

+ 4 - 1
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