mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-13 01:43:09 -06:00
Remove unnecessary req.Close()
Signed-off-by: Anant Prakash <anantprakashjsr@gmail.com>
This commit is contained in:
parent
142fbcde21
commit
c9ab7c9403
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue