Skip to content

Commit c5823a7

Browse files
committed
Fix Duplicate Querystring in test client
1 parent 311159f commit c5823a7

1 file changed

Lines changed: 5 additions & 16 deletions

File tree

runner/testclient/testclient.go

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,25 +80,14 @@ func (api *API) Request(ctx context.Context, method string, path string, body in
8080
return fmt.Errorf("marshalling request: %w", err)
8181
}
8282
bodyReader = bytes.NewReader(bodyBytes)
83-
case http.MethodGet, http.MethodDelete:
84-
85-
qs, ok := body.(interface {
86-
QueryParameters() (url.Values, error)
87-
})
88-
if ok {
89-
query, err := qs.QueryParameters()
90-
if err != nil {
91-
return fmt.Errorf("getting query: %w", err)
92-
}
93-
path = fmt.Sprintf("%s?%s", path, query.Encode())
94-
}
95-
83+
default:
84+
return fmt.Errorf("unsupported method %s with body", method)
9685
}
9786
}
9887

99-
baseURL := api.BaseURL
100-
101-
req, err := http.NewRequest(method, baseURL+path, bodyReader)
88+
fullURL := api.BaseURL + path
89+
fmt.Printf("Full URL %s\n", fullURL)
90+
req, err := http.NewRequest(method, fullURL, bodyReader)
10291
if err != nil {
10392
return err
10493
}

0 commit comments

Comments
 (0)