From 4fff7fc482bcfae2fb9d75d7b15cf4b8af9aff03 Mon Sep 17 00:00:00 2001 From: Simon Stewart Date: Wed, 7 Feb 2018 14:09:55 +0000 Subject: [PATCH] Bump okhttp client to infinity to match old apache httpclient behaviour --- .../org/openqa/selenium/remote/internal/OkHttpClient.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/java/client/src/org/openqa/selenium/remote/internal/OkHttpClient.java b/java/client/src/org/openqa/selenium/remote/internal/OkHttpClient.java index 492d606267ec3..ea2cb6c3be4b4 100644 --- a/java/client/src/org/openqa/selenium/remote/internal/OkHttpClient.java +++ b/java/client/src/org/openqa/selenium/remote/internal/OkHttpClient.java @@ -17,6 +17,8 @@ package org.openqa.selenium.remote.internal; +import static java.util.concurrent.TimeUnit.MINUTES; + import com.google.common.base.Strings; import org.openqa.selenium.remote.http.HttpClient; @@ -34,6 +36,7 @@ import java.io.IOException; import java.net.URL; import java.util.Optional; +import java.util.concurrent.TimeUnit; public class OkHttpClient implements HttpClient { @@ -122,7 +125,8 @@ public HttpClient createClient(URL url) { okhttp3.OkHttpClient.Builder client = new okhttp3.OkHttpClient.Builder() .connectionPool(pool) .followRedirects(true) - .followSslRedirects(true); + .followSslRedirects(true) + .readTimeout(0, MINUTES); String info = url.getUserInfo(); if (!Strings.isNullOrEmpty(info)) {