mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-06 02:48:04 +00:00
refac
This commit is contained in:
parent
934bebd8cd
commit
ce50d9bac4
1 changed files with 3 additions and 0 deletions
|
|
@ -16,6 +16,7 @@ from fastapi.responses import FileResponse
|
|||
|
||||
from open_webui.config import CACHE_DIR
|
||||
from open_webui.constants import ERROR_MESSAGES
|
||||
from open_webui.retrieval.web.utils import validate_url
|
||||
from open_webui.env import ENABLE_FORWARD_USER_INFO_HEADERS
|
||||
|
||||
from open_webui.models.chats import Chats
|
||||
|
|
@ -881,6 +882,8 @@ async def image_edits(
|
|||
return data
|
||||
|
||||
if data.startswith("http://") or data.startswith("https://"):
|
||||
# Validate URL to prevent SSRF attacks against local/private networks
|
||||
validate_url(data)
|
||||
r = await asyncio.to_thread(requests.get, data)
|
||||
r.raise_for_status()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue