Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
varshith257 committed Sep 27, 2024
1 parent 188488a commit da9f025
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions zio-http/shared/src/main/scala/zio/http/Routes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,11 @@ final case class Routes[-Env, +Err](routes: Chunk[zio.http.Route[Env, Err]]) { s
val chunk = tree.get(req.method, req.path)
if (chunk.isEmpty) {
val allowedMethods = tree.getAllMethods(req.path)
if (allowedMethods.nonEmpty) {
if (allowedMethods.nonEmpty && !allowedMethods.contains(req.method)) {
Handler.status(Status.MethodNotAllowed)
} else if (!Method.knownMethods.contains(req.method)) {
Handler.status(Status.NotImplemented)
} else {

Handler.notFound
}
} else {
Expand Down

0 comments on commit da9f025

Please sign in to comment.