@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / d3231cb436
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 15, 23:30 UTC

[Bugfix] Handle content type with optional parameters (#13383)

Signed-off-by: Zifei Tong <zifeitong@gmail.com>

zifeitong committed Feb 18, 2025 at 03:29 UTC d3231cb43651c7d9f457e32708de3c22044c4446
1 file changed +2 -1
vllm/entrypoints/openai/api_server.py
+2 -1
@@ -258,7 +258,8 @@ async def build_async_engine_client_from_engine_args(
258
259 async def validate_json_request(raw_request: Request):
260 content_type = raw_request.headers.get("content-type", "").lower()
261 - if content_type != "application/json":
261 + media_type = content_type.split(";", maxsplit=1)[0]
262 + if media_type != "application/json":
263 raise HTTPException(
264 status_code=HTTPStatus.UNSUPPORTED_MEDIA_TYPE,
265 detail="Unsupported Media Type: Only 'application/json' is allowed"