Skip to content

Commit

Permalink
refactor(models, helper): update identifiers and proxy transport code
Browse files Browse the repository at this point in the history
- Renamed `model_identity` to `dify_model_identity` for clearer specificity
- Added `proxy` parameter to `httpx.HTTPTransport` for SSRF protection adjustments
  • Loading branch information
laipz8200 committed Oct 1, 2024
1 parent 1e62ad2 commit 22f7744
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/core/file/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class FileExtraConfig(BaseModel):


class File(BaseModel):
model_identity: str = FILE_MODEL_IDENTITY
dify_model_identity: str = FILE_MODEL_IDENTITY

id: Optional[str] = None # message file id
tenant_id: str
Expand Down
4 changes: 2 additions & 2 deletions api/core/helper/ssrf_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

proxy_mounts = (
{
"http://": httpx.HTTPTransport(SSRF_PROXY_HTTP_URL),
"https://": httpx.HTTPTransport(SSRF_PROXY_HTTPS_URL),
"http://": httpx.HTTPTransport(proxy=SSRF_PROXY_HTTP_URL),
"https://": httpx.HTTPTransport(proxy=SSRF_PROXY_HTTPS_URL),
}
if SSRF_PROXY_HTTP_URL and SSRF_PROXY_HTTPS_URL
else None
Expand Down

0 comments on commit 22f7744

Please sign in to comment.