浏览代码

request fail when no api key (#23135)

tags/1.7.2
znn 3 个月前
父节点
当前提交
0b44edaca9
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      api/core/workflow/nodes/http_request/executor.py

+ 2
- 2
api/core/workflow/nodes/http_request/executor.py 查看文件

@@ -265,9 +265,9 @@ class Executor:
if not authorization.config.header:
authorization.config.header = "Authorization"

if self.auth.config.type == "bearer":
if self.auth.config.type == "bearer" and authorization.config.api_key:
headers[authorization.config.header] = f"Bearer {authorization.config.api_key}"
elif self.auth.config.type == "basic":
elif self.auth.config.type == "basic" and authorization.config.api_key:
credentials = authorization.config.api_key
if ":" in credentials:
encoded_credentials = base64.b64encode(credentials.encode("utf-8")).decode("utf-8")

正在加载...
取消
保存