url.PathEscape resource ids in the sdk before sending building a request. (#2035)
This commit is contained in:
29 files changed
+199
-87
No files matched your search
@@ -149,7 +149,7 @@ func (c *Client) Read(ctx context.Context, id string, opt ...Option) (*AuthMetho
|
||||
|
||||
opts, apiOpts := getOpts(opt...)
|
||||
|
||||
req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("auth-methods/%s", id), nil, apiOpts...)
|
||||
req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("auth-methods/%s", url.PathEscape(id)), nil, apiOpts...)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error creating Read request: %w", err)
|
||||
}
|
||||
@@ -212,7 +212,7 @@ func (c *Client) Update(ctx context.Context, id string, version uint32, opt ...O
|
||||
|
||||
opts.postMap["version"] = version
|
||||
|
||||
req, err := c.client.NewRequest(ctx, "PATCH", fmt.Sprintf("auth-methods/%s", id), opts.postMap, apiOpts...)
|
||||
req, err := c.client.NewRequest(ctx, "PATCH", fmt.Sprintf("auth-methods/%s", url.PathEscape(id)), opts.postMap, apiOpts...)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error creating Update request: %w", err)
|
||||
}
|
||||
@@ -253,7 +253,7 @@ func (c *Client) Delete(ctx context.Context, id string, opt ...Option) (*AuthMet
|
||||
|
||||
opts, apiOpts := getOpts(opt...)
|
||||
|
||||
req, err := c.client.NewRequest(ctx, "DELETE", fmt.Sprintf("auth-methods/%s", id), nil, apiOpts...)
|
||||
req, err := c.client.NewRequest(ctx, "DELETE", fmt.Sprintf("auth-methods/%s", url.PathEscape(id)), nil, apiOpts...)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error creating Delete request: %w", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user