Set default handler to high rank to prevent collision.

This commit is contained in:
Bill Thiede 2020-06-20 17:08:26 -07:00
parent 76594dc0c1
commit 639a1c7b3a

View File

@ -38,7 +38,7 @@ fn index(lib: State<Library>) -> Result<Content<Vec<u8>>, NotFound<String>> {
file("index.html", lib)
}
#[get("/<path..>")]
#[get("/<path..>", rank = 99)]
fn path(path: PathBuf, lib: State<Library>) -> Result<Content<Vec<u8>>, NotFound<String>> {
let path = path.to_str().unwrap();
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!(" R2 {}", r2);
}
for (r1, r2) in v {
error!(" R1 {:#?}", r1);
error!(" R2 {:#?}", r2);
}
}
_ => (),
};