From 02194ee3c60fa341b658c05f2ef5ec47d3a15ff7 Mon Sep 17 00:00:00 2001 From: Alex Ellis Date: Fri, 27 Jan 2017 17:50:08 +0000 Subject: [PATCH] Fix issue with webhook events not closing Response body, leaving connections open with remote server (#3645) --- cmd/notify-webhook.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/notify-webhook.go b/cmd/notify-webhook.go index 95af0fcb4..875167f79 100644 --- a/cmd/notify-webhook.go +++ b/cmd/notify-webhook.go @@ -119,6 +119,9 @@ func (n httpConn) Fire(entry *logrus.Entry) error { return err } + // Make sure to close the response body so the connection can be re-used. + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusAccepted && resp.StatusCode != http.StatusContinue {