mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-16 11:23:11 -06:00
Return 400 M_NOT_JSON for empty request body in /rooms/:roomID/:action
Fixes #767 Signed-off-by: Priydarshi Singh dryairship@gmail.com
This commit is contained in:
parent
5741235833
commit
d6011fb4d4
|
|
@ -46,6 +46,14 @@ func SendMembership(
|
|||
producer *producers.RoomserverProducer,
|
||||
) util.JSONResponse {
|
||||
var body threepid.MembershipRequest
|
||||
|
||||
if req.Body == http.NoBody {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
JSON: jsonerror.NotJSON("No request body"),
|
||||
}
|
||||
}
|
||||
|
||||
if reqErr := httputil.UnmarshalJSONRequest(req, &body); reqErr != nil {
|
||||
return *reqErr
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue