diff options
author | alezakos <electrovesta@gmail.com> | 2018-09-11 22:58:57 +0300 |
---|---|---|
committer | Jesse Hallam <jesse.hallam@gmail.com> | 2018-09-11 15:58:57 -0400 |
commit | d585f9d9a3bd7c272a02e1d3d52990bc6ecb37a3 (patch) | |
tree | e707643f0daaffe4009f71e2471381989a3ae352 /app/command.go | |
parent | 14928ceb745c1326b281bd7f37fffcbb26cce908 (diff) | |
download | chat-d585f9d9a3bd7c272a02e1d3d52990bc6ecb37a3.tar.gz chat-d585f9d9a3bd7c272a02e1d3d52990bc6ecb37a3.tar.bz2 chat-d585f9d9a3bd7c272a02e1d3d52990bc6ecb37a3.zip |
MM-11895: Don't crush user-provided GET parameters on slash command URLs (#9372)
Diffstat (limited to 'app/command.go')
-rw-r--r-- | app/command.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/command.go b/app/command.go index 124668f6b..a1902bd10 100644 --- a/app/command.go +++ b/app/command.go @@ -233,7 +233,11 @@ func (a *App) ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse, * var req *http.Request if cmd.Method == model.COMMAND_METHOD_GET { req, _ = http.NewRequest(http.MethodGet, cmd.URL, nil) - req.URL.RawQuery = p.Encode() + + if req.URL.RawQuery != "" { + req.URL.RawQuery += "&" + } + req.URL.RawQuery += p.Encode() } else { req, _ = http.NewRequest(http.MethodPost, cmd.URL, strings.NewReader(p.Encode())) } |