Skip to content

Commit

Permalink
ProtocolConverter does not need an HttpClient.Factory as a static field
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Mar 6, 2018
1 parent ddccdc2 commit 89870f0
Showing 1 changed file with 0 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,14 @@
import org.openqa.selenium.remote.http.HttpClient;
import org.openqa.selenium.remote.http.HttpRequest;
import org.openqa.selenium.remote.http.HttpResponse;
import org.openqa.selenium.remote.internal.ApacheHttpClient;
import org.openqa.selenium.remote.internal.JsonToWebElementConverter;
import org.openqa.selenium.remote.internal.OkHttpClient;

import java.io.IOException;
import java.net.URL;
import java.util.Map;

class ProtocolConverter implements SessionCodec {

private final static HttpClient.Factory defaultClientFactory;
static {
String defaultFactory = System.getProperty("webdriver.http.factory", "okhttp");
switch (defaultFactory) {
case "okhttp":
defaultClientFactory = new OkHttpClient.Factory();
break;

case "apache":
default:
defaultClientFactory = new ApacheHttpClient.Factory();
break;
}
}

private final static ImmutableSet<String> IGNORED_REQ_HEADERS = ImmutableSet.<String>builder()
.add("connection")
.add("keep-alive")
Expand Down

0 comments on commit 89870f0

Please sign in to comment.