Prevent panic in influxdb_listener (#4997)

This commit is contained in:
Greg 2018-11-16 11:51:06 -07:00 committed by Daniel Nelson
parent 17079288af
commit d8e3c1d434
1 changed files with 1 additions and 1 deletions

View File

@ -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)