Hey guys, Seems like I found a bug in TestApplica...
# ktor
s
Hey guys, Seems like I found a bug in TestApplicationEngine
Copy code
@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.