Skip to content

Commit

Permalink
revert to previous request configured client builder pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
Anikate-De committed Oct 3, 2024
1 parent f21d51a commit 78d4d2c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkgs/ok_http/lib/src/ok_http_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class OkHttpClient extends BaseClient {
// `followRedirects` is set to `false` to handle redirects manually.
// (Since OkHttp sets a hard limit of 20 redirects.)
// https://github.com/square/okhttp/blob/54238b4c713080c3fd32fb1a070fb5d6814c9a09/okhttp/src/main/kotlin/okhttp3/internal/http/RetryAndFollowUpInterceptor.kt#L350
final reqConfiguredClientBuilder = bindings.RedirectInterceptor.Companion
final reqConfiguredClient = bindings.RedirectInterceptor.Companion
.addRedirectInterceptor(
_client.newBuilder().followRedirects(false),
maxRedirects,
Expand All @@ -233,9 +233,8 @@ class OkHttpClient extends BaseClient {
.readTimeout(configuration.readTimeout.inMilliseconds,
bindings.TimeUnit.MILLISECONDS)
.writeTimeout(configuration.writeTimeout.inMilliseconds,
bindings.TimeUnit.MILLISECONDS);

final reqConfiguredClient = reqConfiguredClientBuilder.build();
bindings.TimeUnit.MILLISECONDS)
.build();

// `enqueue()` schedules the request to be executed in the future.
// https://square.github.io/okhttp/5.x/okhttp/okhttp3/-call/enqueue.html
Expand Down

0 comments on commit 78d4d2c

Please sign in to comment.