router analytics -- close http response body (#1180)

This commit is contained in:
Soam Vasani
2019-05-22 21:41:57 +08:00
committed by Ta-Ching Chen
parent 897771546b
commit 1e8dfa38da
+5 -1
View File
@@ -56,6 +56,10 @@ func (a *Analytics) run() {
continue
}
_, _ = http.Post(a.url, "application/json", bytes.NewReader(msgbytes))
resp, err := http.Post(a.url, "application/json", bytes.NewReader(msgbytes))
if resp != nil {
// close response body to prevent resources leak
resp.Body.Close()
}
}
}