diff --git a/app/notification_push.go b/app/notification_push.go index 71ba57593f..5aa6cf0570 100644 --- a/app/notification_push.go +++ b/app/notification_push.go @@ -4,6 +4,8 @@ package app import ( + "io" + "io/ioutil" "net/http" "runtime" "strings" @@ -370,14 +372,18 @@ func (a *App) SendAckToPushProxy(ack *model.PushNotificationAck) error { return err } - resp, err := a.HTTPService().MakeClient(true).Do(request) + resp, err := a.Srv().pushNotificationClient.Do(request) + if err != nil { + return err + } + defer resp.Body.Close() + // Reading the body to completion. + _, err = io.Copy(ioutil.Discard, resp.Body) if err != nil { return err } - resp.Body.Close() return nil - } func (a *App) getMobileAppSessions(userId string) ([]*model.Session, *model.AppError) {