Skip to content

Commit

Permalink
Fix being able to re-use request path parts in MustDo/Do (#753)
Browse files Browse the repository at this point in the history
  • Loading branch information
MadLittleMods authored Jan 7, 2025
1 parent ec15cf2 commit 08ab613
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,11 @@ func (c *CSAPI) MustDo(t ct.TestLike, method string, paths []string, opts ...Req
// })
func (c *CSAPI) Do(t ct.TestLike, method string, paths []string, opts ...RequestOpt) *http.Response {
t.Helper()
escapedPaths := make([]string, len(paths))
for i := range paths {
paths[i] = url.PathEscape(paths[i])
escapedPaths[i] = url.PathEscape(paths[i])
}
reqURL := c.BaseURL + "/" + strings.Join(paths, "/")
reqURL := c.BaseURL + "/" + strings.Join(escapedPaths, "/")
req, err := http.NewRequest(method, reqURL, nil)
if err != nil {
ct.Fatalf(t, "CSAPI.Do failed to create http.NewRequest: %s", err)
Expand Down

0 comments on commit 08ab613

Please sign in to comment.