Sergey Akhapkin
08/26/2019, 1:31 PM@KtorExperimentalAPI
fun hookRequests(
processRequest: TestApplicationRequest.(setup: TestApplicationRequest.() -> Unit) -> Unit,
processResponse: TestApplicationCall.() -> Unit,
block: () -> Unit
) {
val oldProcessRequest = processRequest /// <<<----------------------- HERE
val oldProcessResponse = processResponse
this.processRequest = {
oldProcessRequest {
processRequest(it)
}
}
there is a clash in names between this.processRequest and function's argument processRequest and it resolved to function's argument. So instead preserving old request processor (and restore later) new processor is stored.
I found this behavior with cookieSession {} extention.
UPD: ktor 1.2.3
UPD2: Filled a ticket.