Skip to content

Commit

Permalink
fix: conformance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Saturn225 authored Oct 26, 2024
1 parent 6a29249 commit 957b35f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions zio-http/shared/src/main/scala/zio/http/Routes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -248,16 +248,14 @@ final case class Routes[-Env, +Err](routes: Chunk[zio.http.Route[Env, Err]]) { s
val tree = self.tree
Handler
.fromFunctionHandler[Request] { req =>
println(s"[DEBUG] Incoming request: Method = ${req.method}, Path = ${req.path}")

val chunk = tree.get(req.method, req.path)
def allowedMethods = tree.getAllMethods(req.path)
req.method match {
case Method.CUSTOM(_) =>
Handler.notImplemented
case _ =>
if (chunk.isEmpty) {
if (allowedMethods.isEmpty) {
if (allowedMethods.isEmpty || allowedMethods == Set(Method.OPTIONS)) {
// If no methods are allowed for the path, return 404 Not Found
Handler.notFound
} else {
Expand Down

0 comments on commit 957b35f

Please sign in to comment.