in http-server/src/main/scala/com/twitter/finatra/http/internal/routing/Routes.scala [29:50]
def handle(request: Request, bypassFilters: Boolean = false): Option[Future[Response]] = {
// store path since Request#path is derived
val path = request.path
val method = request.method
val constantRoute = constantRouteMap.find(path, method)
constantRoute.routeOpt match {
case Some(matchedConstantRoute) =>
// found a constant route match
matchedConstantRoute.handleMatch(request, bypassFilters)
case None =>
// otherwise walk the trie
trie.find(path, method) match {
case Some(RouteAndParameter(nonConstantRoute, routeParams)) =>
nonConstantRoute.handle(request, bypassFilters, routeParams)
case None if constantRoute.methodNotAllowed =>
throw new UnsupportedMethodException(
"The method " + method + " is not allowed on path " + path)
case None => None
}
}
}