From c2511c85a8f0e0c75ac62ac617daa8bec5825f34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Ga=C4=87e=C5=A1a?= Date: Thu, 13 May 2021 18:51:24 +0200 Subject: [PATCH] url escape of 'machine' parameter --- client/http.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/http.go b/client/http.go index d24d8a9..99832cd 100644 --- a/client/http.go +++ b/client/http.go @@ -14,6 +14,7 @@ import ( "io" "io/ioutil" "net/http" + "net/url" "time" "github.com/drone/drone-go/drone" @@ -99,7 +100,7 @@ func (p *HTTPClient) Request(ctx context.Context, args *Filter) (*drone.Stage, e // Accept accepts the build stage for execution. func (p *HTTPClient) Accept(ctx context.Context, stage *drone.Stage) error { - uri := fmt.Sprintf(endpointStage+"?machine=%s", stage.ID, stage.Machine) + uri := fmt.Sprintf(endpointStage+"?machine=%s", stage.ID, url.PathEscape(stage.Machine)) src := stage dst := new(drone.Stage) _, err := p.retry(ctx, uri, "POST", nil, dst)