Skip to content

Commit

Permalink
[java] Timeout should have code 500, see w3c/webdriver#1287
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev authored and Grigory Mischenko committed Sep 20, 2018
1 parent b99a8cf commit 76020ba
Showing 1 changed file with 3 additions and 7 deletions.
Expand Up @@ -162,13 +162,9 @@ public HttpClient createClient(URL url) {
client.addNetworkInterceptor(chain -> {
Request request = chain.request();
Response response = chain.proceed(request);
if (response.code() == 408) {
return response.newBuilder()
.code(404).message("Not Found")
.build();
} else {
return response;
}
return response.code() == 408
? response.newBuilder().code(500).message("Server-Side Timeout").build()
: response;
});

return new OkHttpClient(client.build(), url);
Expand Down

0 comments on commit 76020ba

Please sign in to comment.