mirror of
https://github.com/langgenius/dify.git
synced 2026-05-27 04:16:16 +08:00
[autofix.ci] apply automated fixes
This commit is contained in:
@ -43,9 +43,7 @@ _UPLOAD_FILE_PATH_PATTERN = re.compile(
|
||||
r"^/files/(?P<file_id>[a-fA-F0-9-]+)/(?P<preview_kind>file-preview|image-preview)$"
|
||||
)
|
||||
_TOOL_FILE_PATH_PATTERN = re.compile(r"^/files/tools/(?P<file_id>[a-fA-F0-9-]+)(?P<extension>\.[^/]*)?$")
|
||||
_DATASOURCE_FILE_PATH_PATTERN = re.compile(
|
||||
r"^/files/datasources/(?P<file_id>[a-fA-F0-9-]+)(?P<extension>\.[^/]*)?$"
|
||||
)
|
||||
_DATASOURCE_FILE_PATH_PATTERN = re.compile(r"^/files/datasources/(?P<file_id>[a-fA-F0-9-]+)(?P<extension>\.[^/]*)?$")
|
||||
|
||||
_file_access_controller = DatabaseFileAccessController()
|
||||
|
||||
|
||||
@ -561,10 +561,7 @@ def test_invalid_url_scheme_delegates_to_ssrf_proxy(monkeypatch):
|
||||
|
||||
def test_invalid_url_port_delegates_to_ssrf_proxy(monkeypatch):
|
||||
_patch_file_fetcher_config(monkeypatch)
|
||||
url = (
|
||||
f"http://localhost:invalid/files/{UPLOAD_FILE_ID}/file-preview?"
|
||||
"timestamp=1700000000&nonce=nonce&sign=ignored"
|
||||
)
|
||||
url = f"http://localhost:invalid/files/{UPLOAD_FILE_ID}/file-preview?timestamp=1700000000&nonce=nonce&sign=ignored"
|
||||
proxy_response = httpx.Response(403, request=httpx.Request("GET", "http://proxy.example/fallback"))
|
||||
ssrf_make_request = _patch_ssrf_make_request(monkeypatch, proxy_response)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user