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
@@ -143,7 +143,7 @@ func (c *Client) Read(ctx context.Context, id string, opt ...Option) (*ManagedGr
|
||||
|
||||
opts, apiOpts := getOpts(opt...)
|
||||
|
||||
req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("managed-groups/%s", id), nil, apiOpts...)
|
||||
req, err := c.client.NewRequest(ctx, "GET", fmt.Sprintf("managed-groups/%s", url.PathEscape(id)), nil, apiOpts...)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error creating Read request: %w", err)
|
||||
}
|
||||
@@ -206,7 +206,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("managed-groups/%s", id), opts.postMap, apiOpts...)
|
||||
req, err := c.client.NewRequest(ctx, "PATCH", fmt.Sprintf("managed-groups/%s", url.PathEscape(id)), opts.postMap, apiOpts...)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error creating Update request: %w", err)
|
||||
}
|
||||
@@ -247,7 +247,7 @@ func (c *Client) Delete(ctx context.Context, id string, opt ...Option) (*Managed
|
||||
|
||||
opts, apiOpts := getOpts(opt...)
|
||||
|
||||
req, err := c.client.NewRequest(ctx, "DELETE", fmt.Sprintf("managed-groups/%s", id), nil, apiOpts...)
|
||||
req, err := c.client.NewRequest(ctx, "DELETE", fmt.Sprintf("managed-groups/%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