mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-29 01:42:19 +00:00
refactor(provider): keep trusted AIPG bases immutable
This commit is contained in:
parent
c947cbafbf
commit
46c2b81f29
1 changed files with 1 additions and 1 deletions
|
|
@ -26,7 +26,7 @@ def _resolve_api_key(provider: SimpleProviderConfig, api_base: str, api_key: str
|
|||
return env_key
|
||||
|
||||
env_base: Final = get_secret_str(provider.api_base_env) if provider.api_base_env else None
|
||||
trusted_bases: Final = {base.rstrip("/") for base in (provider.base_url, env_base) if base}
|
||||
trusted_bases: Final = frozenset(base.rstrip("/") for base in (provider.base_url, env_base) if base)
|
||||
if api_base.rstrip("/") not in trusted_bases:
|
||||
raise ValueError(f"api_key is required for custom api_base on provider {provider.slug}")
|
||||
return env_key
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue