From 65f55847a144a1c61775c0097116932f716ee7fa Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 21 Apr 2026 16:04:48 +0900 Subject: [PATCH] refac --- backend/open_webui/retrieval/utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/open_webui/retrieval/utils.py b/backend/open_webui/retrieval/utils.py index b9bfcc12c..fb5a46c2b 100644 --- a/backend/open_webui/retrieval/utils.py +++ b/backend/open_webui/retrieval/utils.py @@ -172,6 +172,11 @@ def _is_text_content_type(content_type: str) -> bool: def get_content_from_url(request, url: str) -> str: + from open_webui.retrieval.web.utils import validate_url + + # Validate URL before making any request (blocks private IPs, non-HTTP, filter list) + validate_url(url) + # Streamed GET to check Content-Type without downloading the body. try: response = requests.get(url, stream=True, timeout=30)