https://kotlinlang.org logo
Title
v

Vladimir Petrakovich

03/13/2019, 1:05 PM
Hi! I'm wondering why query parameters can override path parameters with the same name. For example I have such a route in the application:
route("/{id}") {
    get { println(call.parameters["id"]) }
}
Given a request
GET /foo?id=bar
the printed value will be "bar", not "foo". It looks like this is intended behavior (see https://github.com/ktorio/ktor/blob/d4e1a7caaa031fb466beb1cc102192cc88623bfe/ktor-server/ktor-server-core/jvm/src/io/ktor/routing/RoutingApplicationCall.kt#L25), but why?
r

r4zzz4k

03/14/2019, 1:31 PM
Posted an issue as I'm really curious about this too: https://github.com/ktorio/ktor/issues/1015