MM-36668: Trim large slash commands before logging (#19621)
Automatic Merge
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
a640ba7d05
Коммит
95f784a475
@@ -25,6 +25,7 @@ import (
|
|||||||
const (
|
const (
|
||||||
CmdCustomStatusTrigger = "status"
|
CmdCustomStatusTrigger = "status"
|
||||||
usernameSpecialChars = ".-_"
|
usernameSpecialChars = ".-_"
|
||||||
|
maxTriggerLen = 512
|
||||||
)
|
)
|
||||||
|
|
||||||
var atMentionRegexp = regexp.MustCompile(`\B@[[:alnum:]][[:alnum:]\.\-_:]*`)
|
var atMentionRegexp = regexp.MustCompile(`\B@[[:alnum:]][[:alnum:]\.\-_:]*`)
|
||||||
@@ -225,6 +226,10 @@ func (a *App) ExecuteCommand(c *request.Context, args *model.CommandArgs) (*mode
|
|||||||
return a.HandleCommandResponse(c, cmd, args, response, true)
|
return a.HandleCommandResponse(c, cmd, args, response, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(trigger) > maxTriggerLen {
|
||||||
|
trigger = trigger[:maxTriggerLen]
|
||||||
|
trigger += "..."
|
||||||
|
}
|
||||||
return nil, model.NewAppError("command", "api.command.execute_command.not_found.app_error", map[string]interface{}{"Trigger": trigger}, "", http.StatusNotFound)
|
return nil, model.NewAppError("command", "api.command.execute_command.not_found.app_error", map[string]interface{}{"Trigger": trigger}, "", http.StatusNotFound)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user