From f972f2989cd730b610deba9afe8d8d588bddad68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wenkai=20Yin=28=E5=B0=B9=E6=96=87=E5=BC=80=29?= Date: Tue, 14 Apr 2020 01:19:40 +0800 Subject: [PATCH] Close the reponse body after reading data (#11594) Close the reponse body after reading data Signed-off-by: Wenkai Yin --- src/pkg/registry/auth/authorizer.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pkg/registry/auth/authorizer.go b/src/pkg/registry/auth/authorizer.go index 756a51372..af61fea4a 100644 --- a/src/pkg/registry/auth/authorizer.go +++ b/src/pkg/registry/auth/authorizer.go @@ -86,6 +86,7 @@ func (a *authorizer) initialize(u *url.URL) error { if err != nil { return err } + defer resp.Body.Close() challenges := challenge.ResponseChallenges(resp) // no challenge, mean no auth