fix(outputs.loki): Do not close body before reading it (#14604)
This commit is contained in:
parent
2d4e860d49
commit
98cd14987a
|
|
@ -189,7 +189,7 @@ func (l *Loki) writeMetrics(s Streams) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
_ = resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
|
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
|
||||||
body, _ := io.ReadAll(resp.Body)
|
body, _ := io.ReadAll(resp.Body)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue