From c9ab7c94030681e07eb56068ae8c000cbf077abe Mon Sep 17 00:00:00 2001 From: Anant Prakash Date: Wed, 4 Jul 2018 15:17:16 +0530 Subject: [PATCH] Remove unnecessary req.Close() Signed-off-by: Anant Prakash --- .../matrix-org/dendrite/clientapi/httputil/httputil.go | 1 - 1 file changed, 1 deletion(-) diff --git a/src/github.com/matrix-org/dendrite/clientapi/httputil/httputil.go b/src/github.com/matrix-org/dendrite/clientapi/httputil/httputil.go index bc7e67e0f..11785f517 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/httputil/httputil.go +++ b/src/github.com/matrix-org/dendrite/clientapi/httputil/httputil.go @@ -25,7 +25,6 @@ import ( // UnmarshalJSONRequest into the given interface pointer. Returns an error JSON response if // there was a problem unmarshalling. Calling this function consumes the request body. func UnmarshalJSONRequest(req *http.Request, iface interface{}) *util.JSONResponse { - defer req.Body.Close() // nolint: errcheck if err := json.NewDecoder(req.Body).Decode(iface); err != nil { // TODO: We may want to suppress the Error() return in production? It's useful when // debugging because an error will be produced for both invalid/malformed JSON AND