Skip to content

Commit

Permalink
ensure request body is fully read before closing
Browse files Browse the repository at this point in the history
  • Loading branch information
flxbk committed Jan 3, 2024
1 parent 32537a9 commit 4d8a08d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/frontend/querymiddleware/shard_active_series.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,9 @@ func (s *shardActiveSeriesMiddleware) mergeResponses(ctx context.Context, respon
}
r := res
g.Go(func() error {
defer func(Body io.ReadCloser) {
_ = Body.Close()
defer func(body io.ReadCloser) {
_, _ = io.ReadAll(body)
_ = body.Close()
}(r.Body)

it := jsoniter.Parse(jsoniter.ConfigFastest, r.Body, 512)
Expand Down

0 comments on commit 4d8a08d

Please sign in to comment.