modify file.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
pull/18666/head
GuanMu 1 year ago committed by GitHub
parent 0c4de462a8
commit 21d9e8a210
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -84,7 +84,7 @@ class RemoteFileApi(Resource):
raise FileTooLargeError("File size exceeds the limit.") raise FileTooLargeError("File size exceeds the limit.")
try: try:
content = resp.content if resp.request.method == "GET" else ssrf_proxy.get(url=url, timeout=10).content content = resp.content if resp.request.method == "GET" else ssrf_proxy.get(url=url, timeout=10, follow_redirects=True).content
except httpx.TimeoutException: except httpx.TimeoutException:
raise RemoteFileUploadError(f"Request timed out while downloading file content from {url}.") raise RemoteFileUploadError(f"Request timed out while downloading file content from {url}.")
except httpx.RequestError as e: except httpx.RequestError as e:

Loading…
Cancel
Save