From 3461a7b20704464ee3c19a3dd31805e4c5c1fc4f Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Thu, 12 Oct 2017 08:00:53 -0700 Subject: Add back consumeAndClose functionality. (#7608) * consume bodies for action button integrations, webrtc gateway, oauth endpoint * Fixing a couple more places, switching to io.Copy to ioutil.Discard, adding a comment to help prevent future performance regressions --- app/oauth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/oauth.go') diff --git a/app/oauth.go b/app/oauth.go index 909d16628..5a02f6238 100644 --- a/app/oauth.go +++ b/app/oauth.go @@ -685,7 +685,7 @@ func (a *App) AuthorizeOAuthUser(w http.ResponseWriter, r *http.Request, service return nil, "", stateProps, model.NewAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.token_failed.app_error", nil, err.Error(), http.StatusInternalServerError) } else { ar = model.AccessResponseFromJson(resp.Body) - resp.Body.Close() + consumeAndClose(resp) if ar == nil { return nil, "", stateProps, model.NewAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.bad_response.app_error", nil, "response_body="+string(bodyBytes), http.StatusInternalServerError) -- cgit v1.2.3-1-g7c22