Am I misunderstanding `HttpClient#config`? I expec...
# ktor
o
Am I misunderstanding
HttpClient#config
? I expected that it would be equivalent to adding the given block to the end of the original
config
block, but it instead it overwrites it
d
what are you trying to do?
Have you noticed the
HttpClientConfig#engine
?
o
I used
install
to add some features/interceptors, and I wanted to create another copy with those same features + additional custom interceptors
d
aha
o
it doesn't work since the pipelines aren't copied over, but I don't know if that's intended or a bug
d
indeed, it seems that there is a bug, since the documentation states that it should copy the configuration
Copy code
fun config(block: HttpClientConfig<*>.() -> Unit): HttpClient = HttpClient(
        engine, useDefaultTransformers, HttpClientConfig<HttpClientEngineConfig>().apply(block)
    )
should probably be:
Copy code
fun config(block: HttpClientConfig<*>.() -> Unit): HttpClient = HttpClient(
        engine, useDefaultTransformers, config.clone().apply(block)
    )
o
alright, should I file an issue / make a PR for this?
d
if you can, that would be nice, yeah 🙂 if you make a PR, please ensure to add a test that verifies the new behaviour
o
I can do that, thanks for confirming the bug
👏 1
👍 2