Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AST-38150 version 2.0.13 #277

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

<properties>
<!-- Override the needed properties from the parent pom -->
<revision>2.0.12</revision>
<revision>2.0.13</revision>
<changelist>-SNAPSHOT</changelist>
<!-- Baseline Jenkins version you use to build the plugin. Users must have this version or newer to run. -->
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.concurrent.TimeUnit;

import okhttp3.*;
import okio.ByteString;
import org.apache.commons.lang.StringUtils;

import javax.annotation.Nullable;
Expand All @@ -25,12 +26,13 @@ public OkHttpClient getHttpClient(String proxyString, int connectionTimeoutMilli
if (isValidProxy(proxy.getHost(), proxy.getPort())) {
Proxy _httpProxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxy.getHost(), proxy.getPort()));
if (StringUtils.isNotEmpty(proxy.getUserInfo())) {
String[] userPass = proxy.getUserInfo().split(":");
Authenticator _httpProxyAuth = new Authenticator() {
@Nullable
@Override
public Request authenticate(Route route, Response response) throws IOException {
String credential = Credentials.basic(userPass[0], userPass[1]);
byte[] bytes = proxy.getUserInfo().getBytes("ISO-8859-1");
String encoded = ByteString.of(bytes).base64();
String credential = "Basic " + encoded;
return response.request().newBuilder()
.header("Proxy-Authorization", credential).build();
}
Expand Down
Loading