Skip to content

Commit 93cfa4b

Browse files
authored
Fix/auth uri logging (#297)
* Fixes bad logging for the auth URI; trims auth uri when getting it from viper
1 parent 0d33762 commit 93cfa4b

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

internal/wrappers/client.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,15 @@ func GetURL(path string) string {
229229
}
230230

231231
func GetAuthURL(path string) string {
232-
if viper.GetString(commonParams.BaseAuthURIKey) != "" {
233-
cleanURL := strings.TrimSpace(viper.GetString(commonParams.BaseAuthURIKey))
234-
cleanURL = strings.Trim(cleanURL, "/")
235-
PrintIfVerbose("Auth URL is: " + cleanURL + path)
236-
return fmt.Sprintf("%s/%s", cleanURL, path)
237-
}
238-
PrintIfVerbose("Auth URL is: " + path)
239-
return GetURL(path)
232+
var authURL string
233+
cleanURL := strings.TrimSpace(viper.GetString(commonParams.BaseAuthURIKey))
234+
if cleanURL != "" {
235+
authURL = fmt.Sprintf("%s/%s", strings.Trim(cleanURL, "/"), path)
236+
} else {
237+
authURL = GetURL(path)
238+
}
239+
PrintIfVerbose("Auth URL is: " + authURL)
240+
return authURL
240241
}
241242

242243
func SendHTTPRequestWithQueryParams(method, path string, params map[string]string,

0 commit comments

Comments
 (0)