From 6be5ad590237d298315dda836fb3b1ae7f7302bb Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Thu, 6 Nov 2025 17:28:52 -0800 Subject: [PATCH] fix _parse_request_data_by_content_type --- .../pass_through_endpoints/pass_through_endpoints.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py b/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py index 89a93247ea8..669988d6835 100644 --- a/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py +++ b/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py @@ -942,10 +942,14 @@ async def _parse_request_data_by_content_type( if "application/json" in content_type: # ✅ Handle JSON - body = await request.json() - query_params_data = body.get("query_params") - custom_body_data = body.get("custom_body") - stream = body.get("stream") + try: + body = await request.json() + query_params_data = body.get("query_params") + custom_body_data = body.get("custom_body") + stream = body.get("stream") + except json.JSONDecodeError: + # Handle requests with no body (e.g., DELETE requests) + pass elif "multipart/form-data" in content_type: # ✅ Handle multipart form-data form = await request.form()