You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
tiagoalvesdulce
changed the title
Close the request body with a middleware instead of the handler function body
Close the request body with a middleware instead of within the handler function body
Nov 17, 2022
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
addRoute
method. It should be already working so the calls todefer r.Body.Close
inside handler functions are redundant and can be removed.The text was updated successfully, but these errors were encountered: