mirror of
https://github.com/actix/actix-web.git
synced 2025-06-07 07:38:47 +00:00
Just a bit of sanity check for short paths (#409)
This commit is contained in:
parent
0925a7691a
commit
f6e35a04f0
1 changed files with 2 additions and 0 deletions
|
@ -436,6 +436,7 @@ mod tests {
|
||||||
router.register_resource(resource);
|
router.register_resource(resource);
|
||||||
|
|
||||||
let info = router.default_route_info();
|
let info = router.default_route_info();
|
||||||
|
assert!(!info.has_prefixed_resource("/use/"));
|
||||||
assert!(info.has_resource("/user/test.html"));
|
assert!(info.has_resource("/user/test.html"));
|
||||||
assert!(info.has_prefixed_resource("/user/test.html"));
|
assert!(info.has_prefixed_resource("/user/test.html"));
|
||||||
assert!(!info.has_resource("/test/unknown"));
|
assert!(!info.has_resource("/test/unknown"));
|
||||||
|
@ -468,6 +469,7 @@ mod tests {
|
||||||
|
|
||||||
let mut info = router.default_route_info();
|
let mut info = router.default_route_info();
|
||||||
info.set_prefix(7);
|
info.set_prefix(7);
|
||||||
|
assert!(!info.has_prefixed_resource("/use/"));
|
||||||
assert!(info.has_resource("/user/test.html"));
|
assert!(info.has_resource("/user/test.html"));
|
||||||
assert!(!info.has_prefixed_resource("/user/test.html"));
|
assert!(!info.has_prefixed_resource("/user/test.html"));
|
||||||
assert!(!info.has_resource("/prefix/user/test.html"));
|
assert!(!info.has_resource("/prefix/user/test.html"));
|
||||||
|
|
Loading…
Reference in a new issue