MM-11516: Check channel ID in URL param and Body are same. (#9185)

This commit is contained in:
George Goldberg
2018-07-31 19:13:44 +01:00
committed by Harrison Healey
parent 82dfe9e61d
commit a6c364822a

View File

@@ -90,6 +90,12 @@ func updateChannel(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
// The channel being updated in the payload must be the same one as indicated in the URL.
if channel.Id != c.Params.ChannelId {
c.SetInvalidParam("channel_id")
return
}
var oldChannel *model.Channel
var err *model.AppError
if oldChannel, err = c.App.GetChannel(channel.Id); err != nil {