summaryrefslogtreecommitdiffstats
path: root/api/command.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-06-02 15:40:34 -0400
committerCorey Hulen <corey@hulen.com>2016-06-02 12:40:34 -0700
commit0788e836475722123c36835489396d65c6f9b252 (patch)
treeff18b2e5042e3023f87eb3efffd8b8e7f8f2e75e /api/command.go
parent848a8663ed7f856aee3f801a62b82e87b20de0ea (diff)
downloadchat-0788e836475722123c36835489396d65c6f9b252.tar.gz
chat-0788e836475722123c36835489396d65c6f9b252.tar.bz2
chat-0788e836475722123c36835489396d65c6f9b252.zip
Close HTTP response bodies properly in golang driver (and some api functions) (#3217)
Diffstat (limited to 'api/command.go')
-rw-r--r--api/command.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/api/command.go b/api/command.go
index e1c576bba..953340ccc 100644
--- a/api/command.go
+++ b/api/command.go
@@ -203,6 +203,7 @@ func executeCommand(c *Context, w http.ResponseWriter, r *http.Request) {
handleResponse(c, w, response, channelId, cmd, false)
}
} else {
+ defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
c.Err = model.NewLocAppError("command", "api.command.execute_command.failed_resp.app_error", map[string]interface{}{"Trigger": trigger, "Status": resp.Status}, string(body))
}