pluto
pluto copied to clipboard
Redirect call (HTTP 302 Found) - not working
Describe the bug HTTP call with 302 will throw Ktor exception. Most propable cause is incorrect working with response stream. Please check Pluto against url which will send status code 302 and then redirect to 200 url.
To Reproduce Steps to reproduce the behavior:
- Install PlutoKtorInterceptor - install(PlutoKtorInterceptor)
- Inside application call url which will return status code 302 with redirect to another url which will return 200
- The call will fail inside Ktor - exception below
Response already received: HttpClientCall[https://www.someurl.com, 200 ]
[logged from: e(PlutoLog.kt:6)]
io.ktor.client.call.DoubleReceiveException: Response already received: HttpClientCall[https://www.someurl.com, 200 ]
at io.ktor.client.call.HttpClientCall.bodyNullable(HttpClientCall.kt:80)
at cz.alza.base.lib.homepage.repository.LocalTitleMergeRepository$getLocalTitleItems$1$invokeSuspend$$inlined$submitForm$1$1.invokeSuspend(FormServiceKtor.kt:27)
at cz.alza.base.lib.homepage.repository.LocalTitleMergeRepository$getLocalTitleItems$1$invokeSuspend$$inlined$submitForm$1$1.invoke(Unknown Source:8)
at cz.alza.base.lib.homepage.repository.LocalTitleMergeRepository$getLocalTitleItems$1$invokeSuspend$$inlined$submitForm$1$1.invoke(Unknown Source:4)
at io.ktor.client.statement.HttpStatement.execute(HttpStatement.kt:52)
at io.ktor.client.statement.HttpStatement$execute$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
Expected behavior No exception is thrown.
Smartphone (please complete the following information):
- Device: Android Emulator
- OS: API level 34
- Library Version - 3.0.1