Fix parameter bug of handler inside the filterFunction DSL

Co-authored-by: hojongs <hojong.jjh@gmail.com>
Co-authored-by: bjh970913 <bjh970913@gmail.com>

Closes gh-26838
This commit is contained in:
ShindongLee
2021-04-24 22:27:01 +09:00
committed by Sébastien Deleuze
parent 0468ef46ac
commit 07ba95739b
4 changed files with 45 additions and 4 deletions

View File

@@ -531,8 +531,8 @@ class CoRouterFunctionDsl internal constructor (private val init: (CoRouterFunct
fun filter(filterFunction: suspend (ServerRequest, suspend (ServerRequest) -> ServerResponse) -> ServerResponse) {
builder.filter { serverRequest, handlerFunction ->
mono(Dispatchers.Unconfined) {
filterFunction(serverRequest) {
handlerFunction.handle(serverRequest).awaitSingle()
filterFunction(serverRequest) { handlerRequest ->
handlerFunction.handle(handlerRequest).awaitSingle()
}
}
}