Skip to content

Commit

Permalink
check for proxy variables before setting authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
wetret committed Jul 23, 2024
1 parent 32c69d7 commit de25b4d
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,13 @@ private void configureAuthentication(HttpRequest.Builder builder)

private void configureProxyAuthentication(HttpRequest.Builder builder)
{
// Preemptive proxy basic authentication because non preemptive prxy authentication overrides
// preemptive authentication for oauth2 provider, see configureAuthentication(HttpRequest.Builder builder)
String credentials = getCredentials(proxyUsername, proxyPassword);
builder.header("Proxy-Authorization", "Basic " + credentials);
if (proxyUrl != null && proxyUsername != null & proxyPassword != null)
{
// Preemptive proxy basic authentication because non preemptive prxy authentication overrides
// preemptive authentication for oauth2 provider, see configureAuthentication(HttpRequest.Builder builder)
String credentials = getCredentials(proxyUsername, proxyPassword);
builder.header("Proxy-Authorization", "Basic " + credentials);
}
}

private String getCredentials(String username, String password)
Expand Down

0 comments on commit de25b4d

Please sign in to comment.