mirror of
https://gitee.com/dify_ai/dify.git
synced 2024-12-03 11:48:08 +08:00
fix: update inner api proxies (#9174)
This commit is contained in:
parent
e0c8189f1a
commit
1e7ef46e9c
@ -7,11 +7,16 @@ class EnterpriseRequest:
|
|||||||
base_url = os.environ.get("ENTERPRISE_API_URL", "ENTERPRISE_API_URL")
|
base_url = os.environ.get("ENTERPRISE_API_URL", "ENTERPRISE_API_URL")
|
||||||
secret_key = os.environ.get("ENTERPRISE_API_SECRET_KEY", "ENTERPRISE_API_SECRET_KEY")
|
secret_key = os.environ.get("ENTERPRISE_API_SECRET_KEY", "ENTERPRISE_API_SECRET_KEY")
|
||||||
|
|
||||||
|
proxies = {
|
||||||
|
"http": None,
|
||||||
|
"https": None,
|
||||||
|
}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def send_request(cls, method, endpoint, json=None, params=None):
|
def send_request(cls, method, endpoint, json=None, params=None):
|
||||||
headers = {"Content-Type": "application/json", "Enterprise-Api-Secret-Key": cls.secret_key}
|
headers = {"Content-Type": "application/json", "Enterprise-Api-Secret-Key": cls.secret_key}
|
||||||
|
|
||||||
url = f"{cls.base_url}{endpoint}"
|
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()
|
return response.json()
|
||||||
|
Loading…
Reference in New Issue
Block a user