diff options
author | Torsten Juergeleit <torsten.juergeleit@gmail.com> | 2017-05-31 16:34:05 +0200 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2017-05-31 10:34:05 -0400 |
commit | fdf1164aee36d60b34ca82c07fe02b68e972f53a (patch) | |
tree | decf173e9b6fb8d8f3c10463d065ad9234fc3391 /app/notification.go | |
parent | ddc996f33fc39b2b8f4705d6e1232ccbad1ee4c7 (diff) | |
download | chat-fdf1164aee36d60b34ca82c07fe02b68e972f53a.tar.gz chat-fdf1164aee36d60b34ca82c07fe02b68e972f53a.tar.bz2 chat-fdf1164aee36d60b34ca82c07fe02b68e972f53a.zip |
PLT-5705 Created a single source of http.Client creation logic with internet proxy support, reasonable timeouts and optional insecure connections (#6503)
Diffstat (limited to 'app/notification.go')
-rw-r--r-- | app/notification.go | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/app/notification.go b/app/notification.go index 49576d1f0..90a87ea35 100644 --- a/app/notification.go +++ b/app/notification.go @@ -4,7 +4,6 @@ package app import ( - "crypto/tls" "fmt" "html" "html/template" @@ -557,14 +556,9 @@ func ClearPushNotification(userId string, channelId string) *model.AppError { func sendToPushProxy(msg model.PushNotification, session *model.Session) { msg.ServerId = utils.CfgDiagnosticId - tr := &http.Transport{ - TLSClientConfig: &tls.Config{InsecureSkipVerify: *utils.Cfg.ServiceSettings.EnableInsecureOutgoingConnections}, - DisableKeepAlives: true, - } - httpClient := &http.Client{Transport: tr} request, _ := http.NewRequest("POST", *utils.Cfg.EmailSettings.PushNotificationServer+model.API_URL_SUFFIX_V1+"/send_push", strings.NewReader(msg.ToJson())) - if resp, err := httpClient.Do(request); err != nil { + if resp, err := utils.HttpClient().Do(request); err != nil { l4g.Error("Device push reported as error for UserId=%v SessionId=%v message=%v", session.UserId, session.Id, err.Error()) } else { pushResponse := model.PushResponseFromJson(resp.Body) |