From d02ff60ce15043a76a94bc5258739c0e1bede894 Mon Sep 17 00:00:00 2001 From: Vincent Debergue Date: Mon, 23 Aug 2021 19:19:34 +0200 Subject: [PATCH] Make scalligraph use play.http.context configuration when creating the router --- .../main/scala/org/thp/scalligraph/ScalligraphApplication.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/main/scala/org/thp/scalligraph/ScalligraphApplication.scala b/core/src/main/scala/org/thp/scalligraph/ScalligraphApplication.scala index 3172bb39..210fd739 100644 --- a/core/src/main/scala/org/thp/scalligraph/ScalligraphApplication.scala +++ b/core/src/main/scala/org/thp/scalligraph/ScalligraphApplication.scala @@ -175,6 +175,7 @@ class ScalligraphApplicationImpl(val context: Context) val routers: LazyMutableSeq[Router] = LazyMutableSeq[Router] override lazy val router: Router = initCheck { + val prefix = httpConfiguration.context routers() .reduceOption(_ orElse _) .getOrElse(Router.empty) @@ -183,6 +184,7 @@ class ScalligraphApplicationImpl(val context: Context) case _ => authAction } } + .withPrefix(prefix) } lazy val defaultAction: ActionFunction[Request, AuthenticatedRequest] = new ActionFunction[Request, AuthenticatedRequest] {