From f079f68b019c7e925f997306f550185db763d9e9 Mon Sep 17 00:00:00 2001 From: maco Date: Sun, 9 Aug 2026 20:15:47 +0200 Subject: [PATCH] fix: accept single label hosts once local web fetch is enabled Closes #28161 --- backend/open_webui/retrieval/web/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/retrieval/web/utils.py b/backend/open_webui/retrieval/web/utils.py index 535e1f1b8f..fb2db0d7a1 100644 --- a/backend/open_webui/retrieval/web/utils.py +++ b/backend/open_webui/retrieval/web/utils.py @@ -105,7 +105,8 @@ def _is_global_addr(ip: str) -> bool: def validate_url(url: Union[str, Sequence[str]]): if isinstance(url, str): - if isinstance(validators.url(url), validators.ValidationError): + # simple_host permits TLD-less hosts; resolved addresses are still filtered below + if isinstance(validators.url(url, simple_host=ENABLE_LOCAL_WEB_FETCH), validators.ValidationError): raise ValueError(ERROR_MESSAGES.INVALID_URL) # Reject parser-confusing chars: urlparse and requests/aiohttp split