Skip to content

Commit 9f84544

Browse files
zifeitongjimpang
authored andcommitted
[Bugfix] Handle content type with optional parameters (vllm-project#13383)
Signed-off-by: Zifei Tong <zifeitong@gmail.com>
1 parent ee71ef6 commit 9f84544

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

vllm/entrypoints/openai/api_server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ def _cleanup_ipc_path():
258258

259259
async def validate_json_request(raw_request: Request):
260260
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":
262263
raise HTTPException(
263264
status_code=HTTPStatus.UNSUPPORTED_MEDIA_TYPE,
264265
detail="Unsupported Media Type: Only 'application/json' is allowed"

0 commit comments

Comments
 (0)