https://kotlinlang.org logo
#ktor
Title
# ktor
a

Andy Victors

06/03/2019, 10:59 AM
Copy code
By default, Ktor HTTP client does follow redirections; this feature allows to follow Location redirects in a way that works with any HTTP engine.
vs
Copy code
The iOS engine uses the asynchronous NSURLSession internally. And have no additional configuration.
What is right? I use
followRedirects=false
in MPP common code and on android it works properly but obviously it still follows redirects on iOS. Any way possible to force ktor not to follow redirects on iOS?
e

e5l

06/03/2019, 11:02 AM
It looks like
iOS
requires to disable redirect under the hood. It should be possible with
configureRequest
method in
IosClientEngineConfig
, but obviously should be handled by ktor. Could you file an issue?
a

Andy Victors

06/03/2019, 11:06 AM
Issue simply in github? So do I have a possibility to block autofollowing redirects already now, without waiting for a new release? I tried to find examples for IosClientEngineConfig but not became smart 😕
e

e5l

06/03/2019, 11:06 AM
Yes, github
a

Andy Victors

06/03/2019, 11:12 AM
Done. https://github.com/ktorio/ktor/issues/1167 Is there any workaround I can apply right now?
🚫 1
🙏 1
46 Views