diff options
author | Chris Duarte <csduarte@users.noreply.github.com> | 2017-11-24 09:56:10 -0800 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-11-24 12:56:10 -0500 |
commit | 7ac35548c8ffdcd9b0d2e260d31dbc9adc4a0065 (patch) | |
tree | f252c0d76a4a7f04e3753b4f44b4241595887f95 /app/command.go | |
parent | 45ffa1438c74407e1a9bcf3726fd71cb5491c8ae (diff) | |
download | chat-7ac35548c8ffdcd9b0d2e260d31dbc9adc4a0065.tar.gz chat-7ac35548c8ffdcd9b0d2e260d31dbc9adc4a0065.tar.bz2 chat-7ac35548c8ffdcd9b0d2e260d31dbc9adc4a0065.zip |
Add token to header for commands (#7841)
* add token to header for commands
* Change Header value to Authorization: Token thecommandtoken
Diffstat (limited to 'app/command.go')
-rw-r--r-- | app/command.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/command.go b/app/command.go index aefdf6a73..dc65de6e2 100644 --- a/app/command.go +++ b/app/command.go @@ -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") } |