diff --git a/fastapi/routing.py b/fastapi/routing.py index 8b185d1eaf5e7..57fbbf9662cea 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -180,9 +180,13 @@ async def app(request: Request) -> Response: else: body_bytes = await request.body() if body_bytes: - if request.headers.get( - "Content-Type", "application/octet-stream" - ).endswith("json"): + if ( + request.headers.get( + "Content-Type", "application/octet-stream" + ) + .split(";")[0] + .endswith("json") + ): body = await request.json() else: body = body_bytes