Skip to content

Commit

Permalink
Updated various calls to doRequest to call path.Join instead of fmt.S…
Browse files Browse the repository at this point in the history
…printf
  • Loading branch information
GrantKop committed Aug 25, 2023
1 parent 3171a46 commit 677ef98
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/demisto/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"path"

"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down Expand Up @@ -41,7 +41,7 @@ func (c *Client) GetUsers(ctx context.Context) ([]User, error) {
err := c.doRequest(
ctx,
http.MethodGet,
fmt.Sprintf(UsersBaseURL, c.ApiUrl),
path.Join(UsersBaseURL, c.ApiUrl),
&usersResponse,
nil,
)
Expand All @@ -58,7 +58,7 @@ func (c *Client) GetRoles(ctx context.Context) ([]Role, error) {
err := c.doRequest(
ctx,
http.MethodGet,
fmt.Sprintf(RolesBaseURL, c.ApiUrl),
path.Join(RolesBaseURL, c.ApiUrl),
&rolesResponse,
nil,
)
Expand All @@ -75,7 +75,7 @@ func (c *Client) GetCurrentUser(ctx context.Context) (*User, error) {
err := c.doRequest(
ctx,
http.MethodGet,
fmt.Sprintf(CurrentUserBaseURL, c.ApiUrl),
path.Join(CurrentUserBaseURL, c.ApiUrl),
&user,
nil,
)
Expand Down Expand Up @@ -106,7 +106,7 @@ func (c *Client) UpdateUserRoles(ctx context.Context, userId string, roleIds []s
err := c.doRequest(
ctx,
http.MethodPost,
fmt.Sprintf(UpdateUserBaseURL, c.ApiUrl),
path.Join(UpdateUserBaseURL, c.ApiUrl),
nil,
&data,
)
Expand Down

0 comments on commit 677ef98

Please sign in to comment.