Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
Fix issue where username/password are not encoded for basic auth (#4796)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwmac committed Nov 26, 2020
1 parent 132ccfd commit a01768a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/jetstream/authuaa.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ func (p *portalProxy) getUAAToken(body url.Values, skipSSLValidation bool, clien
return nil, fmt.Errorf(msg, err)
}

req.SetBasicAuth(client, clientSecret)
req.SetBasicAuth(url.QueryEscape(client), url.QueryEscape(clientSecret))
req.Header.Set(echo.HeaderContentType, echo.MIMEApplicationForm)

var h = p.GetHttpClientForRequest(req, skipSSLValidation)
Expand Down
2 changes: 1 addition & 1 deletion src/jetstream/plugins/metrics/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (m *MetricsSpecification) Connect(ec echo.Context, cnsiRecord interfaces.CN

func (m *MetricsSpecification) addAuth(req *http.Request, auth *MetricsAuth) {
if auth.Type == interfaces.AuthConnectTypeCreds {
req.SetBasicAuth(auth.Username, auth.Password)
req.SetBasicAuth(url.QueryEscape(auth.Username), url.QueryEscape(auth.Password))
}
}

Expand Down

0 comments on commit a01768a

Please sign in to comment.