panpf/zoomimage

CoilZoomAsyncImage will discard authentication information

Closed this issue · 1 comments

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.

val options = Options(
context = context,
diskCachePolicy = ENABLED,
networkCachePolicy = ENABLED
)
val mappedData = imageLoader.components.map(url, options)
val fetcher = imageLoader.components.newFetcher(mappedData, options, imageLoader)?.first

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

keta1@549f8ec

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]

Network problem, cannot be solved at zoomimage