Skip to content

Commit

Permalink
Fix endpoint in UpdateRole
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilsbhat committed Apr 28, 2023
1 parent d029f0a commit c0582d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (conf *client) UpdateRole(config Role) (Role, error) {
"If-Match": config.ETAG,
}).
SetBody(config).
Put(RolesEndpoint)
Put(filepath.Join(RolesEndpoint, config.Name))
if err != nil {
return roleCfg, &errors.APIError{Err: err, Message: fmt.Sprintf("update role '%s'", config.Name)}
}
Expand Down
2 changes: 1 addition & 1 deletion roles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ func Test_client_UpdateRole(t *testing.T) {

actual, err := client.UpdateRole(role)
assert.EqualError(t, err, "call made to update role 'blackbird' errored with: "+
"Put \"http://localhost:8156/go/api/admin/security/roles\": dial tcp [::1]:8156: connect: connection refused")
"Put \"http://localhost:8156/go/api/admin/security/roles/blackbird\": dial tcp [::1]:8156: connect: connection refused")
assert.Equal(t, expected, actual)
})
}

0 comments on commit c0582d6

Please sign in to comment.