Skip to content

Commit ed31465

Browse files
committed
revert JoinPath in createHTTPRequest because the input path could contain a query string
1 parent f42f16a commit ed31465

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
@@ -173,7 +173,8 @@ func (c *client) NewHTTPRequest(ctx context.Context, method, p string, body io.R
173173
}
174174

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

0 commit comments

Comments
 (0)