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.