Merging
Этот коммит содержится в:
@@ -36,7 +36,7 @@ func GetCommandProvidersProvider(name string) CommandProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func InitCommand(r *mux.Router) {
|
func InitCommand(r *mux.Router) {
|
||||||
l4g.Debug("Initializing command api routes")
|
l4g.Debug(utils.T("api.command.init.debug"))
|
||||||
|
|
||||||
sr := r.PathPrefix("/commands").Subrouter()
|
sr := r.PathPrefix("/commands").Subrouter()
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ func executeCommand(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
channelId := strings.TrimSpace(props["channelId"])
|
channelId := strings.TrimSpace(props["channelId"])
|
||||||
|
|
||||||
if len(command) <= 1 || strings.Index(command, "/") != 0 {
|
if len(command) <= 1 || strings.Index(command, "/") != 0 {
|
||||||
c.Err = model.NewAppError("command", "Command must start with /", "")
|
c.Err = model.NewLocAppError("executeCommand", "api.command.check_command.start.app_error", nil, "")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -190,8 +190,9 @@ func TestLoadTestUrlCommands(t *testing.T) {
|
|||||||
t.Fatal("/loadtest url with no url should've failed")
|
t.Fatal("/loadtest url with no url should've failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
command = "/loadtest url http://www.hopefullynonexistent.file/path/asdf/qwerty"
|
command = "/loadtest url http://missingfiletonwhere/path/asdf/qwerty"
|
||||||
if r := Client.Must(Client.Command(channel.Id, command, false)).Data.(*model.CommandResponse); r.Text != "Unable to get file" {
|
if r := Client.Must(Client.Command(channel.Id, command, false)).Data.(*model.CommandResponse); r.Text != "Unable to get file" {
|
||||||
|
t.Log(r.Text)
|
||||||
t.Fatal("/loadtest url with invalid url should've failed")
|
t.Fatal("/loadtest url with invalid url should've failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user