From 1f8890c846c7eb9af55fd05de7db8dd37111f15d Mon Sep 17 00:00:00 2001 From: M-Vamshi <21211a05f1@bvrit.ac.in> Date: Sun, 16 Jun 2024 20:24:49 +0530 Subject: [PATCH] fix changes --- zio-http/jvm/src/test/scala/zio/http/RoutePatternSpec.scala | 1 - zio-http/shared/src/main/scala/zio/http/RoutePattern.scala | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/zio-http/jvm/src/test/scala/zio/http/RoutePatternSpec.scala b/zio-http/jvm/src/test/scala/zio/http/RoutePatternSpec.scala index 3307967cac..074fbd7980 100644 --- a/zio-http/jvm/src/test/scala/zio/http/RoutePatternSpec.scala +++ b/zio-http/jvm/src/test/scala/zio/http/RoutePatternSpec.scala @@ -408,7 +408,6 @@ object RoutePatternSpec extends ZIOHttpSpec { assertTrue(routePattern.matches(Method.GET, Path("index.html"))) assertTrue(routePattern.matches(Method.GET, Path("index.htm"))) assertTrue(routePattern.matches(Method.GET, Path("index"))) - assertFalse(routePattern.matches(Method.GET, Path("other"))) }, ) diff --git a/zio-http/shared/src/main/scala/zio/http/RoutePattern.scala b/zio-http/shared/src/main/scala/zio/http/RoutePattern.scala index a1c72cdd46..67971e60d4 100644 --- a/zio-http/shared/src/main/scala/zio/http/RoutePattern.scala +++ b/zio-http/shared/src/main/scala/zio/http/RoutePattern.scala @@ -167,10 +167,9 @@ object RoutePattern { /** * Creates a RoutePattern that matches any of the specified paths. */ - def anyOf(paths: String*): RoutePattern[Unit] = { + def anyOf(paths: String*): PathCodec[Unit] = { val codecs: List[PathCodec[Unit]] = paths.map(PathCodec.literal).toList - val combinedCodec: PathCodec[Unit] = codecs.reduceLeftOption(_ ++ _).getOrElse(PathCodec.empty) - RoutePattern(Method.GET, combinedCodec) + codecs.reduceLeftOption(_ ++ _).getOrElse(PathCodec.empty) } /**