Skip to content

Commit 0dafd5d

Browse files
committed
revert JoinPath in createHTTPRequest because the input path could contain a query string
1 parent 2475734 commit 0dafd5d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

internal/api/api.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ func (c *client) NewHTTPRequest(ctx context.Context, method, p string, body io.R
158158
}
159159

160160
func (c *client) createHTTPRequest(ctx context.Context, method, p string, body io.Reader) (*http.Request, error) {
161-
req, err := http.NewRequestWithContext(ctx, method, c.opts.EndpointURL.JoinPath(p).String(), body)
161+
// Can't use c.opts.EndpointURL.JoinPaht(p) here because `p` could contain a query string
162+
req, err := http.NewRequestWithContext(ctx, method, c.opts.EndpointURL.String()+"/"+p, body)
162163
if err != nil {
163164
return nil, err
164165
}

0 commit comments

Comments
 (0)