mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-23 05:34:41 +00:00
test(e2e): get_text_external accepts JSON next to text so a pod-log error reads as the Kubernetes Status, not a 406 (#47150)
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
0f007c05fc
commit
90fccd4d87
1 changed files with 3 additions and 2 deletions
|
|
@ -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,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue