mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-05 07:57:06 +00:00
fix: accept single label hosts once local web fetch is enabled
Closes #28161
This commit is contained in:
parent
5caa91a493
commit
f079f68b01
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue