We are migrating our application from spray to akka-http. We have a requirement to fetch few attributes from HttpServletRequest
(set by filters).
Spray has a provision to extract HttpServletRequest
by setting spray.servlet.servlet-request-access
to on
, like:
def httpServletRequest(requestContext: RequestContext): Option[HttpServletRequest] = {
requestContext.request.headers collect { case ServletRequestInfoHeader(hsRequest) => hsRequest } headOption
}
However, I couldn't find similar provision in akka-http. Is there a we can acheive this in akka-http?
Update:
As per AKKA-http deployment, spray-servlet is not yet ported to akka-http, and akka runs on embeded webserver. Where as our application runs on Tomcat, So we need to wait for sometime to use akka-http on tomcat.