router analytics -- close http response body (#1180)
This commit is contained in:
committed by
Ta-Ching Chen
parent
897771546b
commit
1e8dfa38da
+5
-1
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user