mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-16 19:33:09 -06:00
used json.valid()
This commit is contained in:
parent
6b89e214d3
commit
292f019467
|
|
@ -92,8 +92,7 @@ func SaveAccountData(
|
|||
return httputil.LogThenError(req, err)
|
||||
}
|
||||
|
||||
var rawJson json.RawMessage
|
||||
if err = json.Unmarshal(body, &rawJson); err != nil {
|
||||
if !json.Valid(body) {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
JSON: jsonerror.BadJSON("Bad JSON content"),
|
||||
|
|
|
|||
Loading…
Reference in a new issue