瀏覽代碼

fix basic auth if not base64 encode (#19242)

Signed-off-by: kenwoodjw <blackxin55+@gmail.com>
tags/1.4.0
kenwoodjw 5 月之前
父節點
當前提交
c5568f756f
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 4 行新增1 行删除
  1. 4
    1
      api/core/workflow/nodes/http_request/executor.py

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

Loading…
取消
儲存