Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
varshith257 committed Sep 25, 2024
1 parent c1205ca commit 5b9cd15
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion zio-http/shared/src/main/scala/zio/http/Routes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,9 @@ final case class Routes[-Env, +Err](routes: Chunk[zio.http.Route[Env, Err]]) { s
val chunk = tree.get(req.method, req.path)
chunk.length match {
case 0 =>
val pathExists = Method.all.exists(method => tree.get(method, req.path).nonEmpty)
val allowedMethods = Method.all.filter(method => tree.get(method, req.path).nonEmpty)
if (allowedMethods.isEmpty) {
if (!pathExists) {
Handler.notFound
} else {
Handler.succeed(
Expand Down

0 comments on commit 5b9cd15

Please sign in to comment.