Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
varshith257 committed Sep 18, 2024
1 parent f4606f3 commit fea95fa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions zio-http/jvm/src/test/scala/zio/http/HandlerAspectSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ object HandlerAspectSpec extends ZIOSpecDefault {
test("HandlerAspect should correctly combine path params and middleware context") {
val route = Method.GET / "base" / string("param") -> handler((param: String, req: Request) => {
withContext((session: Option[WebSession]) => {
val sessionId = session.map(_.id).getOrElse(-1) // Safe handling of session

ZIO.succeed(Response.text(s"Param: $param, SessionId: ${session.get.id}"))
})
}) @@ maybeWebSession
Expand Down

0 comments on commit fea95fa

Please sign in to comment.