Merge branch 'master' into advanced-permissions-phase-1

Этот коммит содержится в:
George Goldberg
2018-03-02 15:55:03 +00:00
родитель 21afaf4bed 2b3b6051d2
Коммит 901acc9703
74 изменённых файлов: 2713 добавлений и 1162 удалений

Просмотреть файл

@@ -212,8 +212,10 @@ func (c *Context) LogAuditWithUserId(userId, extraInfo string) {
func (c *Context) LogError(err *model.AppError) {
// filter out endless reconnects
if c.Path == "/api/v3/users/websocket" && err.StatusCode == 401 || err.Id == "web.check_browser_compatibility.app_error" {
// Filter out 404s, endless reconnects and browser compatibility errors
if err.StatusCode == http.StatusNotFound ||
(c.Path == "/api/v3/users/websocket" && err.StatusCode == 401) ||
err.Id == "web.check_browser_compatibility.app_error" {
c.LogDebug(err)
} else {
l4g.Error(utils.TDefault("api.context.log.error"), c.Path, err.Where, err.StatusCode,
@@ -447,6 +449,18 @@ func (c *Context) RequireFileId() *Context {
return c
}
func (c *Context) RequireFilename() *Context {
if c.Err != nil {
return c
}
if len(c.Params.Filename) == 0 {
c.SetInvalidUrlParam("filename")
}
return c
}
func (c *Context) RequirePluginId() *Context {
if c.Err != nil {
return c