From b61c2bde3a6ee19242be77846271d8f3b5c14e5a Mon Sep 17 00:00:00 2001 From: Vamshi Maskuri <117595548+varshith257@users.noreply.github.com> Date: Fri, 27 Sep 2024 14:23:55 +0530 Subject: [PATCH] fmt --- zio-http/shared/src/main/scala/zio/http/Routes.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zio-http/shared/src/main/scala/zio/http/Routes.scala b/zio-http/shared/src/main/scala/zio/http/Routes.scala index 0d1774c3f4..64a0e523a5 100644 --- a/zio-http/shared/src/main/scala/zio/http/Routes.scala +++ b/zio-http/shared/src/main/scala/zio/http/Routes.scala @@ -252,12 +252,12 @@ final case class Routes[-Env, +Err](routes: Chunk[zio.http.Route[Env, Err]]) { s val allowedMethods = tree.getAllMethods(req.path) chunk.length match { case 0 => - if (allowedMethods.isEmpty) { - Handler.notFound + if (!allowedMethods.isEmpty) { + Handler.status(Status.MethodNotAllowed) } if (!Method.knownMethods.contains(req.method)) { Handler.status(Status.NotImplemented) - } else { Handler.status(Status.MethodNotAllowed) } + } else { Handler.notFound } case 1 => chunk(0) case n => // TODO: Support precomputed fallback among all chunk elements var acc = chunk(0)