Allow Routers to inherit state (#1368)

* Rename Fallback::Custom to Fallback::Service

* Allow Routers to inherit state

* Rename Router::{nest => nest_service} and add new nest method for Routers

* Fix lints

* Add basic tests for state inheritance

* Changelog
This commit is contained in:
Jonas Platte
2022-09-25 11:56:23 +00:00
committed by GitHub
parent 2077d50021
commit 4847d681b1
17 changed files with 453 additions and 225 deletions
+1 -1
View File
@@ -131,7 +131,7 @@ where
// to prevent directory traversal attacks we ensure the path consists of exactly one normal
// component
fn path_is_valid(path: &str) -> bool {
let path = std::path::Path::new(&*path);
let path = std::path::Path::new(path);
let mut components = path.components().peekable();
if let Some(first) = components.peek() {