Fixed bug where root handler was never hit for requests other than exact matches
This commit is contained in:
parent
b085fa5836
commit
54816e1f67
|
@ -48,6 +48,7 @@ fn generate_doc(route_name: &str) -> Document {
|
|||
.add_link_without_label("/")
|
||||
.add_link_without_label("/route")
|
||||
.add_link_without_label("/route/long")
|
||||
.add_link_without_label("/route/not_real");
|
||||
.add_link_without_label("/route/not_real")
|
||||
.add_link_without_label("/rowte");
|
||||
doc
|
||||
}
|
||||
|
|
|
@ -93,7 +93,9 @@ impl RoutingNode {
|
|||
|
||||
let mut node = self;
|
||||
for segment in path.segments() {
|
||||
node = node.1.entry(segment.to_string()).or_default();
|
||||
if segment != "" {
|
||||
node = node.1.entry(segment.to_string()).or_default();
|
||||
}
|
||||
}
|
||||
|
||||
if node.0.is_some() {
|
||||
|
|
Loading…
Reference in a new issue