Set BasicAuth in http.go only if username and password are not empty (#914) #919

Open
github-actions[bot] wants to merge 1 commits from cherry-pick-2663196279-release-1.2 into release-1.2
1 changed files with 3 additions and 1 deletions
Showing only changes of commit ea4c1f0588 - Show all commits

View File

@ -203,7 +203,9 @@ func (self *httpSmartSubtransportStream) sendRequest() error {
req.ContentLength = -1
}
req.SetBasicAuth(userName, password)
if userName != "" && password != "" {
req.SetBasicAuth(userName, password)
}
resp, err = http.DefaultClient.Do(req)
if err != nil {
return err