Hi there. Trying to build url with path containing...
# ktor
a
Hi there. Trying to build url with path containing special symbols:
Copy code
URLBuilder(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.
URLBuilder
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
?