diff options
Diffstat (limited to 'api')
-rw-r--r-- | api/channel.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/api/channel.go b/api/channel.go index 75ca9680d..99640e71a 100644 --- a/api/channel.go +++ b/api/channel.go @@ -205,9 +205,11 @@ func updateChannel(c *Context, w http.ResponseWriter, r *http.Request) { } if oldChannel.Name == model.DEFAULT_CHANNEL { - c.Err = model.NewAppError("updateChannel", "Cannot update the default channel "+model.DEFAULT_CHANNEL, "") - c.Err.StatusCode = http.StatusForbidden - return + if (len(channel.Name) > 0 && channel.Name != oldChannel.Name) || (len(channel.Type) > 0 && channel.Type != oldChannel.Type) { + c.Err = model.NewAppError("updateChannel", "Tried to perform an invalid update of the default channel "+model.DEFAULT_CHANNEL, "") + c.Err.StatusCode = http.StatusForbidden + return + } } oldChannel.Header = channel.Header |