From c5568f756f2d1046a94b4342c7153f48b5239978 Mon Sep 17 00:00:00 2001 From: kenwoodjw Date: Tue, 6 May 2025 09:18:37 +0800 Subject: [PATCH] fix basic auth if not base64 encode (#19242) Signed-off-by: kenwoodjw --- api/core/workflow/nodes/http_request/executor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/core/workflow/nodes/http_request/executor.py b/api/core/workflow/nodes/http_request/executor.py index 5d466e645f..2c42f5a1be 100644 --- a/api/core/workflow/nodes/http_request/executor.py +++ b/api/core/workflow/nodes/http_request/executor.py @@ -262,7 +262,10 @@ class Executor: headers[authorization.config.header] = f"Bearer {authorization.config.api_key}" elif self.auth.config.type == "basic": credentials = authorization.config.api_key - encoded_credentials = base64.b64encode(credentials.encode("utf-8")).decode("utf-8") + if ":" in credentials: + encoded_credentials = base64.b64encode(credentials.encode("utf-8")).decode("utf-8") + else: + encoded_credentials = credentials headers[authorization.config.header] = f"Basic {encoded_credentials}" elif self.auth.config.type == "custom": headers[authorization.config.header] = authorization.config.api_key or ""