From d585f9d9a3bd7c272a02e1d3d52990bc6ecb37a3 Mon Sep 17 00:00:00 2001 From: alezakos Date: Tue, 11 Sep 2018 22:58:57 +0300 Subject: MM-11895: Don't crush user-provided GET parameters on slash command URLs (#9372) --- app/command.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/command.go') 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())) } -- cgit v1.2.3-1-g7c22