Prevent panic in influxdb_listener (#4997)
This commit is contained in:
parent
17079288af
commit
d8e3c1d434
|
@ -254,12 +254,12 @@ func (h *HTTPListener) serveWrite(res http.ResponseWriter, req *http.Request) {
|
|||
if req.Header.Get("Content-Encoding") == "gzip" {
|
||||
var err error
|
||||
body, err = gzip.NewReader(req.Body)
|
||||
defer body.Close()
|
||||
if err != nil {
|
||||
log.Println("D! " + err.Error())
|
||||
badRequest(res, err.Error())
|
||||
return
|
||||
}
|
||||
defer body.Close()
|
||||
}
|
||||
body = http.MaxBytesReader(res, body, h.MaxBodySize.Size)
|
||||
|
||||
|
|
Loading…
Reference in New Issue