Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "4421f42", "specHash": "1715587", "version": "10.1.0" }
{ "engineHash": "e6b1577", "specHash": "1715587", "version": "10.1.0" }
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,7 @@ public BoxNetworkClient(OkHttpClient httpClient) {
}

public BoxNetworkClient() {
OkHttpClient.Builder builder =
new OkHttpClient.Builder()
.followSslRedirects(true)
.followRedirects(false)
.connectionSpecs(singletonList(MODERN_TLS));
httpClient = builder.build();
httpClient = getDefaultOkHttpClientBuilder().build();
}

public OkHttpClient getHttpClient() {
Expand Down Expand Up @@ -390,4 +385,12 @@ public void writeTo(BufferedSink sink) throws IOException {
}
};
}

public static OkHttpClient.Builder getDefaultOkHttpClientBuilder() {
return new OkHttpClient.Builder()
.followSslRedirects(true)
.followRedirects(false)
.connectionSpecs(singletonList(MODERN_TLS))
.retryOnConnectionFailure(false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@ public DefaultNetworkClient(OkHttpClient httpClient) {
}

public DefaultNetworkClient() {
OkHttpClient.Builder builder =
new OkHttpClient.Builder()
.followSslRedirects(true)
.followRedirects(false)
.connectionSpecs(singletonList(MODERN_TLS));
httpClient = builder.build();
httpClient = getDefaultOkHttpClientBuilder().build();
}

public FetchResponse fetch(FetchOptions options) {
Expand Down Expand Up @@ -283,6 +278,14 @@ public void writeTo(BufferedSink sink) throws IOException {
};
}

public static OkHttpClient.Builder getDefaultOkHttpClientBuilder() {
return new OkHttpClient.Builder()
.followSslRedirects(true)
.followRedirects(false)
.connectionSpecs(singletonList(MODERN_TLS))
.retryOnConnectionFailure(false);
}

private static void throwOnUnsuccessfulResponse(
Request request, FetchResponse fetchResponse, Exception exceptionThrown) {
if (fetchResponse == null) {
Expand Down