mirror of
https://github.com/minio/minio.git
synced 2025-04-19 02:05:24 -04: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"
|
"time"
|
||||||
|
|
||||||
"github.com/minio/minio/internal/config/lambda/event"
|
"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/minio/internal/logger"
|
||||||
"github.com/minio/pkg/v2/certs"
|
"github.com/minio/pkg/v2/certs"
|
||||||
xnet "github.com/minio/pkg/v2/net"
|
xnet "github.com/minio/pkg/v2/net"
|
||||||
@ -133,7 +133,7 @@ func (target *WebhookTarget) isActive() (bool, error) {
|
|||||||
}
|
}
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
xioutil.DiscardReader(resp.Body)
|
xhttp.DrainBody(resp.Body)
|
||||||
// No network failure i.e response from the target means its up
|
// No network failure i.e response from the target means its up
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user