You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe I can workaround it in our project locally by creating a vendored copy of GzipSink which does not close upstream sink but flushes it with some help of ugly dirty java tricks accessing kotlin internals it should work but it would be nice to be able to use the original extension method in MultipartBody
Stacktrace:
Exception in thread "main" java.lang.IllegalStateException: closed
at okio.RealBufferedSink.write(RealBufferedSink.kt:176)
at okhttp3.MultipartBody.writeOrCountBytes(MultipartBody.kt:162)
at okhttp3.MultipartBody.writeTo(MultipartBody.kt:99)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:64)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:84)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:65)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:205)
at okhttp3.internal.connection.RealCall.execute(RealCall.kt:158)
at MainKt.main(Main.kt:22)
The text was updated successfully, but these errors were encountered:
Thanks, copying the reproducer here as it looks quite straight forward
val client = OkHttpClient()
val body = MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addPart("part1".toRequestBody().gzip())
.addPart("part2".toRequestBody().gzip())
.build()
val req = Request.Builder()
.post(body)
.url("http://localhost:4040/ingest")
.build()
Reproducer . Tried it on
5.0.0-alpha.11
I believe I can workaround it in our project locally by creating a vendored copy of GzipSink which does not close upstream sink but flushes it with some help of ugly dirty java tricks accessing kotlin internals it should work but it would be nice to be able to use the original extension method in MultipartBody
Stacktrace:
The text was updated successfully, but these errors were encountered: