cvmocanu
09/21/2018, 12:31 PMif (AngularForwardingSelector.shouldForward(requestURI)) {
val requestDispatcher = request.getRequestDispatcher(forwardToUrl)
requestDispatcher.forward(request, response)
} else {
chain.doFilter(request, response)
}
Trying the conversion, I have 2 questions:
- does ktor have around intercerptors? If not, is there a way to stop pipeline from continuing in a before interceptor?
- does kotlin have something similar to request dispatcher (for internal forwarding)?
I tried looking into interceptors, but the documentation is slim, and I can't figure it out how to make it work.orangy
interceptors
are core to #ktor, so absolutely yes. Please check https://ktor.io/advanced/pipeline.html for some details. But basically you need to choose a phase, install interceptor and call finish
if you want to stop the pipeline.orangy
requestDispatcher
, do you mean HTTP redirect? or just internally reroute a call to something else?cvmocanu
09/21/2018, 1:57 PMcvmocanu
09/21/2018, 1:57 PMcvmocanu
09/21/2018, 1:58 PMcvmocanu
09/21/2018, 1:58 PMorangy