Alexander
08/16/2019, 1:02 PMURLBuilder(host = "localhost").apply {
path("%?")
parameters["?"] = "?"
}
.buildString()
.also(::println)
The above code produces <http://localhost/%25??%3F=%3F>
url. The question mark in the path is not encoded. I whould expect the following: <http://localhost/%25%3F?%3F=%3F>
. If I encode it explicitly path("%?".encodeURLPath())
the percent sign is encoded twice.Alexander
08/16/2019, 1:08 PMURLBuilder
uses encodeURLQueryComponent
to encode a path: https://github.com/ktorio/ktor/blob/1.2.3/ktor-http/common/src/io/ktor/http/URLBuilder.kt#L50
Possibly it should use encodeURLPath
?