panpf / zoomimage

ZoomImage is an gesture zoom viewing of images library specially designed for Compose Multiplatform and Android View. Supported scale, pan, locate, rotation, and super-large image subsampling.
Apache License 2.0
330 stars 19 forks source link

CoilZoomAsyncImage will discard authentication information #49

Closed keta1 closed 1 week ago

keta1 commented 1 month ago

Describe the bug

Extra information from the original request will not be retained, If request a picture that requires authentication, it will cause a crash.

https://github.com/panpf/zoomimage/blob/d081255c05907400322c99e3ee5ebb056cf82174/zoomimage-core-coil/src/commonMain/kotlin/com/github/panpf/zoomimage/coil/CoilHttpImageSource.kt#L68-L74

I tried to solve this problem, but there are too many files that need to be modified.

https://github.com/keta1/zoomimage/commit/549f8ec534c9779db8fbcfe7de3b7d1673253354

Is there a better solution to this problem?

coil3.network.HttpException: HTTP 400
 at coil3.network.NetworkFetcher$executeNetworkRequest$2.invokeSuspend(NetworkFetcher.kt:205)
 at coil3.network.NetworkFetcher$executeNetworkRequest$2.invoke(Unknown Source:8)
 at coil3.network.NetworkFetcher$executeNetworkRequest$2.invoke(Unknown Source:4)
 at coil3.network.ktor3.internal.KtorNetworkClient$executeRequest$2.invokeSuspend(utils.kt:35)
 at coil3.network.ktor3.internal.KtorNetworkClient$executeRequest$2.invoke(Unknown Source:8)
 at coil3.network.ktor3.internal.KtorNetworkClient$executeRequest$2.invoke(Unknown Source:4)
 at io.ktor.client.statement.HttpStatement.execute(HttpStatement.kt:47)
 at io.ktor.client.statement.HttpStatement$execute$1.invokeSuspend(Unknown Source:15)
 at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
 at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
 at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113)
 at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
 at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
 at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:823)
 at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
 at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)
 Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@ca79d0b, Dispatchers.Main]
panpf commented 1 week ago

Network problem, cannot be solved at zoomimage