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

@@ -649,8 +649,8 @@ class RouterFunctionDsl internal constructor (private val init: (RouterFunctionD
*/
fun filter(filterFunction: (ServerRequest, (ServerRequest) -> ServerResponse) -> ServerResponse) {
builder.filter { request, next ->
filterFunction(request) {
next.handle(request)
filterFunction(request) { handlerRequest ->
next.handle(handlerRequest)
}
}
}