Skip to content

Commit

Permalink
fix(outputs.loki): Do not close body before reading it (influxdata#14604
Browse files Browse the repository at this point in the history
)
  • Loading branch information
powersj authored Jan 22, 2024
1 parent 2d4e860 commit 98cd149
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/outputs/loki/loki.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func (l *Loki) writeMetrics(s Streams) error {
if err != nil {
return err
}
_ = resp.Body.Close()
defer resp.Body.Close()

if resp.StatusCode < 200 || resp.StatusCode >= 300 {
body, _ := io.ReadAll(resp.Body)
Expand Down

0 comments on commit 98cd149

Please sign in to comment.