diff --git a/pkg/common/common.go b/pkg/common/common.go index 60e7979e..df1f809f 100644 --- a/pkg/common/common.go +++ b/pkg/common/common.go @@ -147,9 +147,11 @@ func MakeHTTPGetRequest(httpClient *http.Client, username string, password strin return nil, 0, err } - req.Header.Set("Content-Type", mediaType) + req.Header.Set("Accept", mediaType) - req.SetBasicAuth(username, password) + if username != "" && password != "" { + req.SetBasicAuth(username, password) + } resp, err := httpClient.Do(req) if err != nil {