From 65addb49428559803bccf19fca5b5362d908a0cd Mon Sep 17 00:00:00 2001 From: Jose Antonio Insua Date: Thu, 22 Apr 2021 01:36:09 +0200 Subject: [PATCH] bugfix: make profile command to use the new proxy feature --- ims/profile.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ims/profile.go b/ims/profile.go index 96d6412..bdc376f 100644 --- a/ims/profile.go +++ b/ims/profile.go @@ -31,9 +31,8 @@ func (i Config) validateGetProfileConfig() error { return nil } -/* - * GetProfile requests the user profile using an access token. - */ + +// GetProfile requests the user profile using an access token. func (i Config) GetProfile() (string, error) { err := i.validateGetProfileConfig() @@ -41,8 +40,14 @@ func (i Config) GetProfile() (string, error) { return "", fmt.Errorf("invalid parameters for profile: %v", err) } + httpClient, err := i.httpClient() + if err != nil { + return "", fmt.Errorf("error creating the HTTP Client: %v", err) + } + c, err := ims.NewClient(&ims.ClientConfig{ URL: i.URL, + Client: httpClient, }) if err != nil { return "", fmt.Errorf("error creating the client: %v", err)