Make sure to drain body upon an error (#7197)

Also cleanup redundant code and use it at a common place
This commit is contained in:
Harshavardhana
2019-02-06 12:07:03 -08:00
committed by kannappanr
parent 2d168b532b
commit 817269475f
9 changed files with 83 additions and 83 deletions

View File

@@ -25,6 +25,7 @@ import (
"sync"
"github.com/minio/minio/cmd/crypto"
xhttp "github.com/minio/minio/cmd/http"
"github.com/minio/minio/cmd/logger"
"github.com/minio/minio/pkg/auth"
"github.com/minio/minio/pkg/event"
@@ -552,7 +553,7 @@ func (s *serverConfig) loadToCachedConfigs() {
URL: s.Policy.OPA.URL,
AuthToken: s.Policy.OPA.AuthToken,
Transport: NewCustomHTTPTransport(),
CloseRespFn: CloseResponse,
CloseRespFn: xhttp.DrainBody,
})
}
}