Merge pull request #8 from marko-gacesa/machine-param-escape

url escape of 'machine' parameter
pull/9/head
TP Honey 3 years ago committed by GitHub
commit 874c664428
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)

Loading…
Cancel
Save