Skip to content

Commit 08ab613

Browse files
Fix being able to re-use request path parts in MustDo/Do (#753)
1 parent ec15cf2 commit 08ab613

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

client/client.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -572,10 +572,11 @@ func (c *CSAPI) MustDo(t ct.TestLike, method string, paths []string, opts ...Req
572572
// })
573573
func (c *CSAPI) Do(t ct.TestLike, method string, paths []string, opts ...RequestOpt) *http.Response {
574574
t.Helper()
575+
escapedPaths := make([]string, len(paths))
575576
for i := range paths {
576-
paths[i] = url.PathEscape(paths[i])
577+
escapedPaths[i] = url.PathEscape(paths[i])
577578
}
578-
reqURL := c.BaseURL + "/" + strings.Join(paths, "/")
579+
reqURL := c.BaseURL + "/" + strings.Join(escapedPaths, "/")
579580
req, err := http.NewRequest(method, reqURL, nil)
580581
if err != nil {
581582
ct.Fatalf(t, "CSAPI.Do failed to create http.NewRequest: %s", err)

0 commit comments

Comments
 (0)