Skip to content

Commit

Permalink
fix: check for EOF body in upstream influxdb listener
Browse files Browse the repository at this point in the history
Throughout the influx parsing logic there are checks for receiving an
EOF body. When received the parsing logic returns. When content is gzip
we check for any error and return that error, but do not do any specific
chesk for EOF.

Fixes: #10900
  • Loading branch information
powersj committed Apr 12, 2022
1 parent bed3b4b commit 3ec4267
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/inputs/influxdb_listener/influxdb_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,9 @@ func (h *InfluxDBListener) handleWriteUpstreamParser(res http.ResponseWriter, re
if req.Header.Get("Content-Encoding") == "gzip" {
var err error
body, err = gzip.NewReader(body)
if err != nil {
if err == influx_upstream.ErrEOF {
return
} else if err != nil {
h.Log.Debugf("Error decompressing request body: %v", err.Error())
if err := badRequest(res, err.Error()); err != nil {
h.Log.Debugf("error in bad-request: %v", err)
Expand Down

0 comments on commit 3ec4267

Please sign in to comment.