浏览代码

fix: update inner api proxies (#9174)

tags/0.9.2
Joe 1年前
父节点
当前提交
1e7ef46e9c
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6
    1
      api/services/enterprise/base.py

+ 6
- 1
api/services/enterprise/base.py 查看文件

@@ -7,11 +7,16 @@ class EnterpriseRequest:
base_url = os.environ.get("ENTERPRISE_API_URL", "ENTERPRISE_API_URL")
secret_key = os.environ.get("ENTERPRISE_API_SECRET_KEY", "ENTERPRISE_API_SECRET_KEY")

proxies = {
"http": None,
"https": None,
}

@classmethod
def send_request(cls, method, endpoint, json=None, params=None):
headers = {"Content-Type": "application/json", "Enterprise-Api-Secret-Key": cls.secret_key}

url = f"{cls.base_url}{endpoint}"
response = requests.request(method, url, json=json, params=params, headers=headers)
response = requests.request(method, url, json=json, params=params, headers=headers, proxies=cls.proxies)

return response.json()

正在加载...
取消
保存