From ca5a58207416f56c99428dcb2a0a25474bc953ab Mon Sep 17 00:00:00 2001 From: "jar3b@outlook.com" Date: Thu, 7 Oct 2021 22:24:57 +0300 Subject: [PATCH] fix: add body close call --- request.go | 1 + 1 file changed, 1 insertion(+) diff --git a/request.go b/request.go index 5e534ae..7144824 100644 --- a/request.go +++ b/request.go @@ -12,6 +12,7 @@ func (r *Request) FromHTTP(req *http.Request) error { return errors.New("nats_transport: request cannot be nil") } + defer req.Body.Close() buf, err := ioutil.ReadAll(req.Body) if err != nil { return fmt.Errorf("nats_transport: cannot read request body")