Skip to content

Commit

Permalink
[java] set client config version as string and convert in Jdk Client
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Oct 10, 2023
1 parent c1a74e7 commit 64bcbd7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions java/src/org/openqa/selenium/remote/http/ClientConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.http.HttpClient;
import java.time.Duration;
import javax.net.ssl.SSLContext;
import org.openqa.selenium.Credentials;
Expand All @@ -40,7 +39,7 @@ public class ClientConfig {
private final Proxy proxy;
private final Credentials credentials;
private final SSLContext sslContext;
private HttpClient.Version version;
private String version;

protected ClientConfig(
URI baseUri,
Expand All @@ -50,7 +49,7 @@ protected ClientConfig(
Proxy proxy,
Credentials credentials,
SSLContext sslContext,
HttpClient.Version version) {
String version) {
this.baseUri = baseUri;
this.connectionTimeout = Require.nonNegative("Connection timeout", connectionTimeout);
this.readTimeout = Require.nonNegative("Read timeout", readTimeout);
Expand Down Expand Up @@ -214,7 +213,7 @@ public SSLContext sslContext() {
return sslContext;
}

public ClientConfig version(HttpClient.Version version) {
public ClientConfig version(String version) {
return new ClientConfig(
baseUri,
connectionTimeout,
Expand All @@ -226,7 +225,7 @@ public ClientConfig version(HttpClient.Version version) {
Require.nonNull("Version", version));
}

public HttpClient.Version version() {
public String version() {
return version;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {
builder.sslContext(sslContext);
}

Version version = config.version();
String version = config.version();
if (version != null) {
builder.version(version);
builder.version(Version.valueOf(version));
}

this.client = builder.build();
Expand Down

0 comments on commit 64bcbd7

Please sign in to comment.