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)
|
return httputil.LogThenError(req, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var rawJson json.RawMessage
|
if !json.Valid(body) {
|
||||||
if err = json.Unmarshal(body, &rawJson); err != nil {
|
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusBadRequest,
|
||||||
JSON: jsonerror.BadJSON("Bad JSON content"),
|
JSON: jsonerror.BadJSON("Bad JSON content"),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue