"vscode:/vscode.git/clone" did not exist on "561d6f8077c54c7af5dbf2ed92131ce9f7d9b56b"
Unverified Commit d3231cb4 authored by zifeitong's avatar zifeitong Committed by GitHub
Browse files

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


Signed-off-by: default avatarZifei Tong <zifeitong@gmail.com>
parent 435b502a
...@@ -258,7 +258,8 @@ async def build_async_engine_client_from_engine_args( ...@@ -258,7 +258,8 @@ async def build_async_engine_client_from_engine_args(
async def validate_json_request(raw_request: Request): async def validate_json_request(raw_request: Request):
content_type = raw_request.headers.get("content-type", "").lower() content_type = raw_request.headers.get("content-type", "").lower()
if content_type != "application/json": media_type = content_type.split(";", maxsplit=1)[0]
if media_type != "application/json":
raise HTTPException( raise HTTPException(
status_code=HTTPStatus.UNSUPPORTED_MEDIA_TYPE, status_code=HTTPStatus.UNSUPPORTED_MEDIA_TYPE,
detail="Unsupported Media Type: Only 'application/json' is allowed" detail="Unsupported Media Type: Only 'application/json' is allowed"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment