From f6e35a04f0f58f5f94f3d37dd9c03428392027b0 Mon Sep 17 00:00:00 2001 From: Douman Date: Fri, 20 Jul 2018 07:48:57 +0300 Subject: [PATCH] Just a bit of sanity check for short paths (#409) --- src/httprequest.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/httprequest.rs b/src/httprequest.rs index 67afaf03b..83017dfa0 100644 --- a/src/httprequest.rs +++ b/src/httprequest.rs @@ -436,6 +436,7 @@ mod tests { router.register_resource(resource); let info = router.default_route_info(); + assert!(!info.has_prefixed_resource("/use/")); assert!(info.has_resource("/user/test.html")); assert!(info.has_prefixed_resource("/user/test.html")); assert!(!info.has_resource("/test/unknown")); @@ -468,6 +469,7 @@ mod tests { let mut info = router.default_route_info(); info.set_prefix(7); + assert!(!info.has_prefixed_resource("/use/")); assert!(info.has_resource("/user/test.html")); assert!(!info.has_prefixed_resource("/user/test.html")); assert!(!info.has_resource("/prefix/user/test.html"));