From 215ca58d6af718b49410782cccc092c247a40fd4 Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Sat, 18 Nov 2023 04:02:26 +0800 Subject: [PATCH] fix: close the http.Body when WebhookTarget isActive (#18467) --- internal/config/lambda/target/webhook.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/config/lambda/target/webhook.go b/internal/config/lambda/target/webhook.go index e3a5e5576..f69ea7e03 100644 --- a/internal/config/lambda/target/webhook.go +++ b/internal/config/lambda/target/webhook.go @@ -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 }