From 54d4b860de71f688a17277d0da4ca89f224d8286 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 2 Oct 2018 17:14:44 +0200 Subject: [PATCH] release req.Body when serving http --- server.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server.go b/server.go index e7f7160..56c73e8 100644 --- a/server.go +++ b/server.go @@ -108,6 +108,8 @@ func New(_path string) (*Server, error) { // ServeHTTP implements http.Handler and has to be called on each request func (s *Server) ServeHTTP(res http.ResponseWriter, req *http.Request) { + defer req.Body.Close() + /* (1) Build request */ apiRequest, err := apirequest.FromHTTP(req) if err != nil {