Skip to content

Commit

Permalink
fix changes
Browse files Browse the repository at this point in the history
  • Loading branch information
varshith257 committed Jun 16, 2024
1 parent 36c624c commit 1f8890c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")))
},
)

Expand Down
5 changes: 2 additions & 3 deletions zio-http/shared/src/main/scala/zio/http/RoutePattern.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

/**
Expand Down

0 comments on commit 1f8890c

Please sign in to comment.