diff --git a/app/plugin_api.go b/app/plugin_api.go index 91e690ad1a..a0a982a543 100644 --- a/app/plugin_api.go +++ b/app/plugin_api.go @@ -898,6 +898,7 @@ func (api *PluginAPI) PluginHTTP(request *http.Request) *http.Response { } destinationPluginId := split[1] newURL, err := url.Parse("/" + split[2]) + newURL.RawQuery = request.URL.Query().Encode() request.URL = newURL if destinationPluginId == "" || err != nil { message := "No plugin specified. Form of URL should be //*" diff --git a/app/plugin_api_test.go b/app/plugin_api_test.go index 48c4bf0e7a..4df144db46 100644 --- a/app/plugin_api_test.go +++ b/app/plugin_api_test.go @@ -1381,6 +1381,11 @@ func TestInterpluginPluginHTTP(t *testing.T) { if r.URL.Path != "/api/v2/test" { return } + + if r.URL.Query().Get("abc") != "xyz" { + return + } + buf := bytes.Buffer{} buf.ReadFrom(r.Body) resp := "we got:" + buf.String() @@ -1410,7 +1415,7 @@ func TestInterpluginPluginHTTP(t *testing.T) { func (p *MyPlugin) MessageWillBePosted(c *plugin.Context, post *model.Post) (*model.Post, string) { buf := bytes.Buffer{} buf.WriteString("This is the request") - req, err := http.NewRequest("GET", "/testplugininterserver/api/v2/test", &buf) + req, err := http.NewRequest("GET", "/testplugininterserver/api/v2/test?abc=xyz", &buf) if err != nil { return nil, err.Error() }