Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test(e2e): get_text_external accepts JSON next to text so a pod-log error reads as the Kubernetes Status, not a 406 (#47150)

Kerry Lu90fccd4d8758
diff --git a/tests/e2e/e2e_http.py b/tests/e2e/e2e_http.py
index 90a9e9367eb..2aea32909ce 100644
--- a/tests/e2e/e2e_http.py
+++ b/tests/e2e/e2e_http.py
@@ -507,11 +507,12 @@ def get_text_external(
ca_bundle: str | None = None,
) -> str | NetworkError:
"""GET an absolute URL outside the proxy whose body is plain text (e.g. a pod log), not JSON.
- A non-2xx status is reported as a NetworkError so the caller can fail loudly."""
+ A non-2xx status is reported as a NetworkError so the caller can fail loudly. JSON is accepted too so an API
+ that answers an error as a JSON document (the Kubernetes Status on a pod log) returns that error instead of a 406."""
try:
resp = requests.get(
url,
- headers={"Accept": "text/plain", **(_headers(headers) if headers is not None else {})},
+ headers={"Accept": "text/plain, application/json", **(_headers(headers) if headers is not None else {})},
timeout=timeout,
verify=ca_bundle if ca_bundle is not None else True,
)