diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-10-12 08:00:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-12 08:00:53 -0700 |
commit | 3461a7b20704464ee3c19a3dd31805e4c5c1fc4f (patch) | |
tree | b14ad4935a9453157024e638b5c468a1833e0eae /app/post.go | |
parent | 521e27f4ace125b47879b38edbad07d7c21a54e6 (diff) | |
download | chat-3461a7b20704464ee3c19a3dd31805e4c5c1fc4f.tar.gz chat-3461a7b20704464ee3c19a3dd31805e4c5c1fc4f.tar.bz2 chat-3461a7b20704464ee3c19a3dd31805e4c5c1fc4f.zip |
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
Diffstat (limited to 'app/post.go')
-rw-r--r-- | app/post.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/post.go b/app/post.go index 94f4acbe7..d51ba7103 100644 --- a/app/post.go +++ b/app/post.go @@ -676,7 +676,7 @@ func GetOpenGraphMetadata(url string) *opengraph.OpenGraph { l4g.Error("GetOpenGraphMetadata request failed for url=%v with err=%v", url, err.Error()) return og } - defer res.Body.Close() + defer consumeAndClose(res) if err := og.ProcessHTML(res.Body); err != nil { l4g.Error("GetOpenGraphMetadata processing failed for url=%v with err=%v", url, err.Error()) @@ -712,7 +712,7 @@ func (a *App) DoPostAction(postId string, actionId string, userId string) *model if err != nil { return model.NewAppError("DoPostAction", "api.post.do_action.action_integration.app_error", nil, "err="+err.Error(), http.StatusBadRequest) } - defer resp.Body.Close() + defer consumeAndClose(resp) if resp.StatusCode != http.StatusOK { return model.NewAppError("DoPostAction", "api.post.do_action.action_integration.app_error", nil, fmt.Sprintf("status=%v", resp.StatusCode), http.StatusBadRequest) |