summaryrefslogtreecommitdiffstats
path: root/app/command.go
diff options
context:
space:
mode:
authorTorsten Juergeleit <torsten.juergeleit@gmail.com>2017-05-31 16:34:05 +0200
committerHarrison Healey <harrisonmhealey@gmail.com>2017-05-31 10:34:05 -0400
commitfdf1164aee36d60b34ca82c07fe02b68e972f53a (patch)
treedecf173e9b6fb8d8f3c10463d065ad9234fc3391 /app/command.go
parentddc996f33fc39b2b8f4705d6e1232ccbad1ee4c7 (diff)
downloadchat-fdf1164aee36d60b34ca82c07fe02b68e972f53a.tar.gz
chat-fdf1164aee36d60b34ca82c07fe02b68e972f53a.tar.bz2
chat-fdf1164aee36d60b34ca82c07fe02b68e972f53a.zip
PLT-5705 Created a single source of http.Client creation logic with internet proxy support, reasonable timeouts and optional insecure connections (#6503)
Diffstat (limited to 'app/command.go')
-rw-r--r--app/command.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/app/command.go b/app/command.go
index 2af934710..bfb97ae0c 100644
--- a/app/command.go
+++ b/app/command.go
@@ -4,7 +4,6 @@
package app
import (
- "crypto/tls"
"fmt"
"io/ioutil"
"net/http"
@@ -204,18 +203,13 @@ func ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse, *model.App
method = "GET"
}
- tr := &http.Transport{
- TLSClientConfig: &tls.Config{InsecureSkipVerify: *utils.Cfg.ServiceSettings.EnableInsecureOutgoingConnections},
- }
- client := &http.Client{Transport: tr}
-
req, _ := http.NewRequest(method, cmd.URL, strings.NewReader(p.Encode()))
req.Header.Set("Accept", "application/json")
if cmd.Method == model.COMMAND_METHOD_POST {
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
}
- if resp, err := client.Do(req); err != nil {
+ if resp, err := utils.HttpClient().Do(req); err != nil {
return nil, model.NewAppError("command", "api.command.execute_command.failed.app_error", map[string]interface{}{"Trigger": trigger}, err.Error(), http.StatusInternalServerError)
} else {
if resp.StatusCode == http.StatusOK {