MM-11855 Add App.HTTPService to allow mocking of HTTP client (#9359)
* MM-11855 Add App.HTTPService to allow mocking of HTTP client * Initialize HTTPService earlier
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
2910007033
Коммит
0027d99855
@@ -244,7 +244,7 @@ func (a *App) ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse, *
|
||||
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
|
||||
}
|
||||
|
||||
if resp, err := a.HTTPClient(false).Do(req); err != nil {
|
||||
if resp, err := a.HTTPService.MakeClient(false).Do(req); err != nil {
|
||||
return nil, model.NewAppError("command", "api.command.execute_command.failed.app_error", map[string]interface{}{"Trigger": trigger}, err.Error(), http.StatusInternalServerError)
|
||||
} else {
|
||||
if resp.StatusCode == http.StatusOK {
|
||||
|
||||
Ссылка в новой задаче
Block a user