mirror of
https://github.com/Rarebuffalo/securelens-backend.git
synced 2026-06-19 07:00:30 +00:00
spoof User-Agent for Agent Router calls to bypass unauthorized client detection
This commit is contained in:
@@ -76,6 +76,10 @@ async def call_ai(
|
||||
|
||||
if settings.ai_api_base:
|
||||
kwargs["api_base"] = settings.ai_api_base
|
||||
if "agentrouter.org" in settings.ai_api_base.lower():
|
||||
kwargs["extra_headers"] = {
|
||||
"User-Agent": "claude-code/0.2.9",
|
||||
}
|
||||
|
||||
# JSON mode: supported natively by OpenAI and LiteLLM proxied Gemini.
|
||||
# For providers that don't support it, LiteLLM silently ignores the flag.
|
||||
|
||||
Reference in New Issue
Block a user