litellm/tests/test_litellm/proxy/pass_through_endpoints
Sameer Kankute c2fca1124b fix(proxy): preserve multipart/form-data boundary in passthrough endpoints
Fixes issue where multipart file uploads through passthrough endpoints failed with RequestValidationError. The proxy was consuming the request body stream and FastAPI was trying to parse multipart bodies as JSON dicts.

Changes:
- Try JSON parsing first for multipart content-type (handles misconfigured clients)
- Skip multipart parsing if JSON succeeds to avoid stream consumption
- Remove custom_body parameter from endpoint_func to prevent FastAPI auto-parsing
- Check for parsed body before using multipart handler
- Add regression test for multipart boundary preservation

Handles both actual multipart uploads and JSON bodies with incorrect multipart content-type headers.

Made-with: Cursor
2026-03-11 16:52:02 +05:30
..
llm_provider_handlers Development environment setup (#22432) 2026-02-28 14:50:06 -08:00
test_llm_pass_through_endpoints.py Development environment setup (#22432) 2026-02-28 14:50:06 -08:00
test_method_specific_routing.py Add test got method speicifc routing 2026-02-19 11:58:48 +05:30
test_pass_through_endpoints.py fix(proxy): preserve multipart/form-data boundary in passthrough endpoints 2026-03-11 16:52:02 +05:30
test_passthrough_endpoints_common_utils.py
test_passthrough_guardrails_field_targeting.py chore: cleanup unused scripts and fix misplaced test file (#17611) 2025-12-08 19:00:55 -08:00
test_passthrough_guardrails.py [Feat] Add guardrails for pass through endpoints (#17221) 2025-11-27 12:06:53 -08:00
test_vertex_ai_batch_passthrough.py Managed batches fixes for Gemini/Vertex 2026-02-28 20:45:16 -05:00
test_vertex_passthrough_load_balancing.py Fix test_vertex_passthrough_forwards_anthropic_beta_header 2026-02-26 13:06:25 +05:30