mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-19 16:19:12 +08:00
refactor(models, helper): update identifiers and proxy transport code
- Renamed `model_identity` to `dify_model_identity` for clearer specificity - Added `proxy` parameter to `httpx.HTTPTransport` for SSRF protection adjustments
This commit is contained in:
parent
afb3e317d3
commit
5c64792793
@ -34,7 +34,7 @@ class FileExtraConfig(BaseModel):
|
|||||||
|
|
||||||
|
|
||||||
class File(BaseModel):
|
class File(BaseModel):
|
||||||
model_identity: str = FILE_MODEL_IDENTITY
|
dify_model_identity: str = FILE_MODEL_IDENTITY
|
||||||
|
|
||||||
id: Optional[str] = None # message file id
|
id: Optional[str] = None # message file id
|
||||||
tenant_id: str
|
tenant_id: str
|
||||||
|
@ -15,8 +15,8 @@ SSRF_DEFAULT_MAX_RETRIES = int(os.getenv("SSRF_DEFAULT_MAX_RETRIES", "3"))
|
|||||||
|
|
||||||
proxy_mounts = (
|
proxy_mounts = (
|
||||||
{
|
{
|
||||||
"http://": httpx.HTTPTransport(SSRF_PROXY_HTTP_URL),
|
"http://": httpx.HTTPTransport(proxy=SSRF_PROXY_HTTP_URL),
|
||||||
"https://": httpx.HTTPTransport(SSRF_PROXY_HTTPS_URL),
|
"https://": httpx.HTTPTransport(proxy=SSRF_PROXY_HTTPS_URL),
|
||||||
}
|
}
|
||||||
if SSRF_PROXY_HTTP_URL and SSRF_PROXY_HTTPS_URL
|
if SSRF_PROXY_HTTP_URL and SSRF_PROXY_HTTPS_URL
|
||||||
else None
|
else None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user