Set default handler to high rank to prevent collision.
This commit is contained in:
parent
76594dc0c1
commit
639a1c7b3a
@ -38,7 +38,7 @@ fn index(lib: State<Library>) -> Result<Content<Vec<u8>>, NotFound<String>> {
|
|||||||
file("index.html", lib)
|
file("index.html", lib)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/<path..>")]
|
#[get("/<path..>", rank = 99)]
|
||||||
fn path(path: PathBuf, lib: State<Library>) -> Result<Content<Vec<u8>>, NotFound<String>> {
|
fn path(path: PathBuf, lib: State<Library>) -> Result<Content<Vec<u8>>, NotFound<String>> {
|
||||||
let path = path.to_str().unwrap();
|
let path = path.to_str().unwrap();
|
||||||
let path = if path.ends_with("/") {
|
let path = if path.ends_with("/") {
|
||||||
@ -134,6 +134,10 @@ pub fn run(addr: SocketAddr, lib: Library) -> Result<(), Box<dyn Error>> {
|
|||||||
error!(" R1 {}", r1);
|
error!(" R1 {}", r1);
|
||||||
error!(" R2 {}", r2);
|
error!(" R2 {}", r2);
|
||||||
}
|
}
|
||||||
|
for (r1, r2) in v {
|
||||||
|
error!(" R1 {:#?}", r1);
|
||||||
|
error!(" R2 {:#?}", r2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_ => (),
|
_ => (),
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user