Skip to content

Commit 9af3c11

Browse files
committed
Avoid re-using a corrupted zstd decompressor
1 parent 94d52ac commit 9af3c11

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

receiver/libhoneyreceiver/receiver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ func (r *libhoneyReceiver) handleEvent(resp http.ResponseWriter, req *http.Reque
231231
if err != nil {
232232
r.settings.Logger.Error("Failed to read request body", zap.Error(err))
233233
writeLibhoneyError(resp, enc, "failed to read request body")
234-
// Drain any remaining body to allow connection reuse
234+
// Don't try to drain body if we got an error from compressed reader
235+
// The reader may be in a corrupted state and cause another panic
235236
if req.Body != nil {
236-
_, _ = io.ReadAll(req.Body)
237237
_ = req.Body.Close()
238238
}
239239
return

0 commit comments

Comments
 (0)