File tree Expand file tree Collapse file tree 3 files changed +19
-13
lines changed
src/main/java/com/box/sdkgen/networking Expand file tree Collapse file tree 3 files changed +19
-13
lines changed Original file line number Diff line number Diff line change 1- { "engineHash" : " 8db6e62 " , "specHash" : " 1715587" , "version" : " 5.0.0" }
1+ { "engineHash" : " e6b1577 " , "specHash" : " 1715587" , "version" : " 5.0.0" }
Original file line number Diff line number Diff line change @@ -60,12 +60,7 @@ public BoxNetworkClient(OkHttpClient httpClient) {
6060 }
6161
6262 public BoxNetworkClient () {
63- OkHttpClient .Builder builder =
64- new OkHttpClient .Builder ()
65- .followSslRedirects (true )
66- .followRedirects (false )
67- .connectionSpecs (singletonList (MODERN_TLS ));
68- httpClient = builder .build ();
63+ httpClient = getDefaultOkHttpClientBuilder ().build ();
6964 }
7065
7166 public OkHttpClient getHttpClient () {
@@ -390,4 +385,12 @@ public void writeTo(BufferedSink sink) throws IOException {
390385 }
391386 };
392387 }
388+
389+ public static OkHttpClient .Builder getDefaultOkHttpClientBuilder () {
390+ return new OkHttpClient .Builder ()
391+ .followSslRedirects (true )
392+ .followRedirects (false )
393+ .connectionSpecs (singletonList (MODERN_TLS ))
394+ .retryOnConnectionFailure (false );
395+ }
393396}
Original file line number Diff line number Diff line change @@ -42,12 +42,7 @@ public DefaultNetworkClient(OkHttpClient httpClient) {
4242 }
4343
4444 public DefaultNetworkClient () {
45- OkHttpClient .Builder builder =
46- new OkHttpClient .Builder ()
47- .followSslRedirects (true )
48- .followRedirects (false )
49- .connectionSpecs (singletonList (MODERN_TLS ));
50- httpClient = builder .build ();
45+ httpClient = getDefaultOkHttpClientBuilder ().build ();
5146 }
5247
5348 public FetchResponse fetch (FetchOptions options ) {
@@ -283,6 +278,14 @@ public void writeTo(BufferedSink sink) throws IOException {
283278 };
284279 }
285280
281+ public static OkHttpClient .Builder getDefaultOkHttpClientBuilder () {
282+ return new OkHttpClient .Builder ()
283+ .followSslRedirects (true )
284+ .followRedirects (false )
285+ .connectionSpecs (singletonList (MODERN_TLS ))
286+ .retryOnConnectionFailure (false );
287+ }
288+
286289 private static void throwOnUnsuccessfulResponse (
287290 Request request , FetchResponse fetchResponse , Exception exceptionThrown ) {
288291 if (fetchResponse == null ) {
You can’t perform that action at this time.
0 commit comments