mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
fix: close the http.Body when WebhookTarget isActive (#18467)
This commit is contained in:
parent
12f570a307
commit
215ca58d6a
@ -30,7 +30,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/minio/minio/internal/config/lambda/event"
|
||||
xioutil "github.com/minio/minio/internal/ioutil"
|
||||
xhttp "github.com/minio/minio/internal/http"
|
||||
"github.com/minio/minio/internal/logger"
|
||||
"github.com/minio/pkg/v2/certs"
|
||||
xnet "github.com/minio/pkg/v2/net"
|
||||
@ -133,7 +133,7 @@ func (target *WebhookTarget) isActive() (bool, error) {
|
||||
}
|
||||
return false, err
|
||||
}
|
||||
xioutil.DiscardReader(resp.Body)
|
||||
xhttp.DrainBody(resp.Body)
|
||||
// No network failure i.e response from the target means its up
|
||||
return true, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user