diff --git a/tests/llm/upstream.py b/tests/llm/upstream.py index 5eb2aae..745eec6 100644 --- a/tests/llm/upstream.py +++ b/tests/llm/upstream.py @@ -26,6 +26,11 @@ class H(BaseHTTPRequestHandler): "path": self.path, "method": self.command, "auth": self.headers.get("Authorization", "-"), + # x-api-key / anthropic-version 必须记:Anthropic 协议的上游只认 + # `x-api-key`,而网关当前只覆写 Authorization。**不记就意味着 + # 「下游那把 sk_ 是否被原样漏给上游」这件事在这里是看不见的**。 + "x_api_key": self.headers.get("x-api-key", "-"), + "anthropic_version": self.headers.get("anthropic-version", "-"), "host": self.headers.get("Host", "-"), "body": body.decode("utf-8", "replace"), }