fix Command Code 403: add cc_version field + x-command-code-version header

This commit is contained in:
admin
2026-05-19 18:28:56 +04:00
Unverified
parent a2dde4d331
commit ba9831db2d
3 changed files with 16 additions and 0 deletions

View File

@@ -80,6 +80,7 @@ BACKEND = CONFIG["backend_type"]
TARGET_URL = CONFIG["target_url"].rstrip("/")
API_KEY = CONFIG["api_key"]
MODELS = CONFIG["models"]
CC_VERSION = CONFIG.get("cc_version", "")
# ═══════════════════════════════════════════════════════════════════
# Shared helpers
@@ -745,6 +746,7 @@ class Handler(http.server.BaseHTTPRequestHandler):
"Content-Type": "application/json",
"Authorization": f"Bearer {API_KEY}",
"Accept": "text/event-stream, application/json",
"x-command-code-version": CC_VERSION or "0.26.8",
}, browser_ua=True)
print(f"[translate-proxy] POST {target} model={model} stream={stream} [command-code]", file=sys.stderr)
req = urllib.request.Request(