|
17 | 17 |
|
18 | 18 | package org.openqa.selenium.grid.router; |
19 | 19 |
|
20 | | -import static org.openqa.selenium.remote.HttpSessionId.getSessionId; |
21 | | -import static org.openqa.selenium.remote.RemoteTags.SESSION_ID; |
22 | | -import static org.openqa.selenium.remote.RemoteTags.SESSION_ID_EVENT; |
23 | | -import static org.openqa.selenium.remote.http.Contents.asJson; |
24 | | -import static org.openqa.selenium.remote.tracing.Tags.EXCEPTION; |
25 | | -import static org.openqa.selenium.remote.tracing.Tags.HTTP_REQUEST; |
26 | | -import static org.openqa.selenium.remote.tracing.Tags.HTTP_REQUEST_EVENT; |
27 | | -import static org.openqa.selenium.remote.tracing.Tags.HTTP_RESPONSE; |
28 | | - |
29 | 20 | import com.google.common.cache.Cache; |
30 | 21 | import com.google.common.cache.CacheBuilder; |
31 | 22 | import com.google.common.cache.RemovalListener; |
|
39 | 30 | import org.openqa.selenium.internal.Require; |
40 | 31 | import org.openqa.selenium.net.Urls; |
41 | 32 | import org.openqa.selenium.remote.SessionId; |
| 33 | +import org.openqa.selenium.remote.http.ClientConfig; |
42 | 34 | import org.openqa.selenium.remote.http.HttpClient; |
43 | 35 | import org.openqa.selenium.remote.http.HttpHandler; |
44 | 36 | import org.openqa.selenium.remote.http.HttpRequest; |
|
60 | 52 | import java.util.concurrent.ScheduledExecutorService; |
61 | 53 | import java.util.concurrent.TimeUnit; |
62 | 54 |
|
| 55 | +import static org.openqa.selenium.remote.HttpSessionId.getSessionId; |
| 56 | +import static org.openqa.selenium.remote.RemoteTags.SESSION_ID; |
| 57 | +import static org.openqa.selenium.remote.RemoteTags.SESSION_ID_EVENT; |
| 58 | +import static org.openqa.selenium.remote.http.Contents.asJson; |
| 59 | +import static org.openqa.selenium.remote.tracing.Tags.EXCEPTION; |
| 60 | +import static org.openqa.selenium.remote.tracing.Tags.HTTP_REQUEST; |
| 61 | +import static org.openqa.selenium.remote.tracing.Tags.HTTP_REQUEST_EVENT; |
| 62 | +import static org.openqa.selenium.remote.tracing.Tags.HTTP_RESPONSE; |
| 63 | + |
63 | 64 | class HandleSession implements HttpHandler { |
64 | 65 |
|
65 | 66 | private final Tracer tracer; |
@@ -157,7 +158,10 @@ private Callable<HttpHandler> loadSessionId(Tracer tracer, Span span, SessionId |
157 | 158 | () -> { |
158 | 159 | Session session = sessions.get(id); |
159 | 160 | URL url = Urls.fromUri(session.getUri()); |
160 | | - HttpClient client = httpClients.get(url, () -> httpClientFactory.createClient(url)); |
| 161 | + ClientConfig config = ClientConfig.defaultConfig() |
| 162 | + .baseUrl(url) |
| 163 | + .withRetries(); |
| 164 | + HttpClient client = httpClients.get(url, () -> httpClientFactory.createClient(config)); |
161 | 165 | return new ReverseProxyHandler(tracer, client); |
162 | 166 | } |
163 | 167 | ); |
|
0 commit comments