Fix issue with webhook events not closing Response body, leaving connections open with remote server (#3645)

This commit is contained in:
Alex Ellis 2017-01-27 17:50:08 +00:00 committed by Harshavardhana
parent 85f2b74cfd
commit 02194ee3c6
1 changed files with 3 additions and 0 deletions

View File

@ -119,6 +119,9 @@ func (n httpConn) Fire(entry *logrus.Entry) error {
return err 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 && if resp.StatusCode != http.StatusOK &&
resp.StatusCode != http.StatusAccepted && resp.StatusCode != http.StatusAccepted &&
resp.StatusCode != http.StatusContinue { resp.StatusCode != http.StatusContinue {