mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-05-25 19:20:16 +00:00
Merge remote-tracking branch 'pr/1244' into stage/batch-v0.50.238
This commit is contained in:
@@ -1660,6 +1660,11 @@ def get_available_models() -> dict:
|
||||
# Build set of hostnames from custom_providers config — these are
|
||||
# user-explicitly configured endpoints and should not be blocked by SSRF.
|
||||
_ssrf_trusted_hosts: set[str] = set()
|
||||
# Also trust the base_url from model config (explicitly configured by user)
|
||||
if cfg_base_url:
|
||||
_base_parsed = urlparse(cfg_base_url if "://" in cfg_base_url else f"http://{cfg_base_url}")
|
||||
if _base_parsed.hostname:
|
||||
_ssrf_trusted_hosts.add(_base_parsed.hostname.lower())
|
||||
_custom_providers_cfg = cfg.get("custom_providers", [])
|
||||
if isinstance(_custom_providers_cfg, list):
|
||||
for _cp in _custom_providers_cfg:
|
||||
|
||||
Reference in New Issue
Block a user