Add token to header for commands (#7841)

* add token to header for commands

* Change Header value to Authorization: Token thecommandtoken
This commit is contained in:
Chris Duarte
2017-11-24 09:56:10 -08:00
committed by Joram Wilander
parent 45ffa1438c
commit 7ac35548c8

View File

@@ -217,6 +217,7 @@ func (a *App) ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse, *
req, _ := http.NewRequest(method, cmd.URL, strings.NewReader(p.Encode()))
req.Header.Set("Accept", "application/json")
req.Header.Set("Authorization", "Token "+cmd.Token)
if cmd.Method == model.COMMAND_METHOD_POST {
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
}