From 81dc4ff3c1cd52f4f72fdc9711f4461c4d448078 Mon Sep 17 00:00:00 2001 From: Corentin Leruth Date: Sun, 16 Jun 2024 12:22:23 +0200 Subject: [PATCH] return NoMatch --- src/routes.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/routes.ml b/src/routes.ml index 02704b2..8137c8d 100644 --- a/src/routes.ml +++ b/src/routes.ml @@ -201,7 +201,10 @@ let parse_route path handler params = = fun t f seen s -> match t with - | End -> FullMatch [ f ] + | End -> + (match s with + | [] | [ "" ] -> FullMatch [ f ] + | _ -> NoMatch) | Wildcard -> FullMatch [ f { Parts.prefix = List.rev seen; matched = s } ] | Match (x, fmt) -> (match s with