ByteZ
on
finish
proceed
if (rate.check()) { proceed() } else { call.respond(HttpStatusCode.TooManyRequests) finish() }
pipeline.intercept(ApplicationCallPipeline.Setup)
Aleksei Tirman [JB]
Is there no way to access the pipeline context within the new on functions in plugins?
Will ktor automatically detect that the request has already received a response and not pass it further down the pipeline?
Routing
val plugin = createApplicationPlugin("plugin") { onCall { call -> if (!rate.check()) { call.respond(HttpStatusCode.TooManyRequests) } } }
A modern programming language that makes developers happier.