From 3461a7b20704464ee3c19a3dd31805e4c5c1fc4f Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Thu, 12 Oct 2017 08:00:53 -0700 Subject: Add back consumeAndClose functionality. (#7608) * consume bodies for action button integrations, webrtc gateway, oauth endpoint * Fixing a couple more places, switching to io.Copy to ioutil.Discard, adding a comment to help prevent future performance regressions --- app/webhook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/webhook.go') diff --git a/app/webhook.go b/app/webhook.go index d3d9bbf8b..dbe444a25 100644 --- a/app/webhook.go +++ b/app/webhook.go @@ -109,7 +109,7 @@ func (a *App) TriggerWebhook(payload *model.OutgoingWebhookPayload, hook *model. if resp, err := utils.HttpClient(false).Do(req); err != nil { l4g.Error(utils.T("api.post.handle_webhook_events_and_forget.event_post.error"), err.Error()) } else { - defer resp.Body.Close() + defer consumeAndClose(resp) webhookResp := model.OutgoingWebhookResponseFromJson(resp.Body) if webhookResp != nil && webhookResp.Text != nil { -- cgit v1.2.3-1-g7c22