fix: hotfix: log needs to happen after filter rejection fallthrough
This commit is contained in:
parent
5a9d4f6098
commit
415e4e120e
|
@ -838,7 +838,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lonk"
|
name = "lonk"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"argh",
|
"argh",
|
||||||
"async-object-pool",
|
"async-object-pool",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "lonk"
|
name = "lonk"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
11
src/main.rs
11
src/main.rs
|
@ -1218,8 +1218,7 @@ async fn serve() {
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
Err((status, message)) => Response::builder().status(status).body(message).unwrap(),
|
Err((status, message)) => Response::builder().status(status).body(message).unwrap(),
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
.with(log);
|
|
||||||
|
|
||||||
// GET /l/:Slug
|
// GET /l/:Slug
|
||||||
let link = warp::path("l")
|
let link = warp::path("l")
|
||||||
|
@ -1233,19 +1232,17 @@ async fn serve() {
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
Err((status, message)) => Response::builder().status(status).body(message).unwrap(),
|
Err((status, message)) => Response::builder().status(status).body(message).unwrap(),
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
.with(log);
|
|
||||||
|
|
||||||
// GET /
|
// GET /
|
||||||
// This should be the last thing matched, so that anything that doesn't
|
// This should be the last thing matched, so that anything that doesn't
|
||||||
// match another filter will try to match a file.
|
// match another filter will try to match a file.
|
||||||
let homepage = warp::get()
|
let homepage = warp::get()
|
||||||
.and(config.serve_rules.dir.to_filter())
|
.and(config.serve_rules.dir.to_filter());
|
||||||
.with(log);
|
|
||||||
|
|
||||||
let get_routes = warp::get().and(link.or(homepage));
|
let get_routes = warp::get().and(link.or(homepage));
|
||||||
let post_routes = warp::post().and(shorten);
|
let post_routes = warp::post().and(shorten);
|
||||||
let routes = get_routes.or(post_routes);
|
let routes = get_routes.or(post_routes).with(log);
|
||||||
|
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"Now serving lonk at IP {}, port {}!",
|
"Now serving lonk at IP {}, port {}!",
|
||||||
|
|
Loading…
Reference in New Issue