From 0027d998555d47f9a75a896d8c6c85a8b4645ad0 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Fri, 7 Sep 2018 09:24:18 -0400 Subject: 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 --- app/notification_push.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/notification_push.go') diff --git a/app/notification_push.go b/app/notification_push.go index 12d9f5258..517988a97 100644 --- a/app/notification_push.go +++ b/app/notification_push.go @@ -184,7 +184,7 @@ func (a *App) sendToPushProxy(msg model.PushNotification, session *model.Session request, _ := http.NewRequest("POST", strings.TrimRight(*a.Config().EmailSettings.PushNotificationServer, "/")+model.API_URL_SUFFIX_V1+"/send_push", strings.NewReader(msg.ToJson())) - if resp, err := a.HTTPClient(true).Do(request); err != nil { + if resp, err := a.HTTPService.MakeClient(true).Do(request); err != nil { mlog.Error(fmt.Sprintf("Device push reported as error for UserId=%v SessionId=%v message=%v", session.UserId, session.Id, err.Error()), mlog.String("user_id", session.UserId)) } else { pushResponse := model.PushResponseFromJson(resp.Body) -- cgit v1.2.3-1-g7c22