Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenliang123 committed Nov 7, 2024
1 parent eea76bd commit 2e7ce1c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions api/configs/feature/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@ def WEB_API_CORS_ALLOW_ORIGINS(self) -> list[str]:
default=3,
)

SSRF_PROXY_ALL_URL: Optional[str] = Field(
description="Proxy URL for HTTP or HTTPS requests to prevent Server-Side Request Forgery (SSRF)",
default=None,
)

SSRF_PROXY_HTTP_URL: Optional[str] = Field(
description="Proxy URL for HTTP requests to prevent Server-Side Request Forgery (SSRF)",
default=None,
Expand Down
7 changes: 3 additions & 4 deletions api/core/helper/ssrf_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
"""

import logging
import os
import time

import httpx

from configs import dify_config

SSRF_PROXY_ALL_URL = os.getenv("SSRF_PROXY_ALL_URL", "")
SSRF_PROXY_HTTP_URL = os.getenv("SSRF_PROXY_HTTP_URL", "")
SSRF_PROXY_HTTPS_URL = os.getenv("SSRF_PROXY_HTTPS_URL", "")
SSRF_PROXY_ALL_URL = dify_config.SSRF_PROXY_ALL_URL
SSRF_PROXY_HTTP_URL = dify_config.SSRF_PROXY_HTTP_URL
SSRF_PROXY_HTTPS_URL = dify_config.SSRF_PROXY_HTTPS_URL
SSRF_DEFAULT_MAX_RETRIES = dify_config.SSRF_DEFAULT_MAX_RETRIES

proxy_mounts = (
Expand Down

0 comments on commit 2e7ce1c

Please sign in to comment.