As mentioned by Luke here: #84 (comment).
We already have the middleware defined here:
|
func closeBody(f http.HandlerFunc) http.HandlerFunc { |
And are using it here:
|
func (d *DcrtimeStore) addRoute(method string, route string, handler http.HandlerFunc) { |
As we add every route with the addRoute method. It should be already working so the calls to defer r.Body.Close inside handler functions are redundant and can be removed.
As mentioned by Luke here: #84 (comment).
We already have the middleware defined here:
dcrtime/dcrtimed/dcrtimed.go
Line 1297 in bbebe6d
And are using it here:
dcrtime/dcrtimed/dcrtimed.go
Line 1306 in bbebe6d
As we add every route with the
addRoutemethod. It should be already working so the calls todefer r.Body.Closeinside handler functions are redundant and can be removed.