Colton Idle
03/31/2023, 4:56 AMToo many follow-up requests: 21
(full stacktrace in thread, stacktrace mentions both of these interceptors)
interceptor 1
class AddOutboundAcceptHeaderInterceptor @Inject constructor() : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {
val request = chain.request().newBuilder().addHeader("Accept", "application/json").build()
return chain.proceed(request)
}
}
interceptor 2
class AddOutboundBasicAuthHeaderInterceptor
@Inject
constructor(private val buildTimeValues: BuildTimeValues) : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {
val auth = "Basic ${buildTimeValues.basicAuth.encodeUtf8().base64()}"
val request = chain.request().newBuilder().addHeader("Authorization", auth).build()
return chain.proceed(request)
}
}
Fatal Exception: java.net.ProtocolException: Too many follow-up requests: 21
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:283)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:132)
at com.rollertoaster.app.hilt.AddOutboundBasicAuthHeaderInterceptor.intercept(AddOutboundBasicAuthHeaderInterceptor.java:111)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:132)
at com.rollertoaster.app.misc.AddOutboundAcceptHeaderInterceptor.intercept(AddOutboundAcceptHeaderInterceptor.java:85)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:132)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.java:100)
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.java:110)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
yschimke
03/31/2023, 5:29 AMColton Idle
03/31/2023, 5:40 AMyschimke
03/31/2023, 6:29 AMColton Idle
03/31/2023, 6:34 AMaddHeader
instead of header
. Does that seem problematic to you?yschimke
03/31/2023, 8:22 PMColton Idle
03/31/2023, 8:39 PMyschimke
03/31/2023, 8:40 PMColton Idle
03/31/2023, 8:41 PMyschimke
03/31/2023, 8:41 PMColton Idle
03/31/2023, 8:42 PMyschimke
03/31/2023, 8:43 PMColton Idle
03/31/2023, 8:44 PM