[Bugfix][Frontend] Return 400 for malformed RL dev route bodies (#59236)

Signed-off-by: aoshen02 <aoshen02@users.noreply.github.com>
Co-authored-by: aoshen02 <aoshen02@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
aoshen02
2026-09-29 16:46:56 +00:00
committed by GitHub
co-authored by aoshen02 Claude Opus 5.5
parent 31876d8ea1
commit cd94b21264
3 changed files with 115 additions and 23 deletions
@@ -29,6 +29,11 @@ async def collective_rpc(raw_request: Request):
status_code=HTTPStatus.BAD_REQUEST.value,
detail=f"JSON decode error: {e}",
) from e
if not isinstance(body, dict):
raise HTTPException(
status_code=HTTPStatus.BAD_REQUEST.value,
detail="Request body must be a JSON object",
)
method = body.get("method")
if method is None:
raise HTTPException(