-
SummaryRouter::new().route("/dav/d", MethodRouter::new().fallback("handler"))
There's an empty axum version0.7.x |
Beta Was this translation helpful? Give feedback.
Answered by
kkocdko
Jan 28, 2024
Replies: 2 comments
-
Remove header by middleware is useless. app.layer(axum::middleware::from_fn(
|req: Request<Body>, next: Next| async {
println!(
"> req.method() = {}, req.uri() = {}, req.headers() = {:?}",
req.method(),
req.uri(),
req.headers()
);
let mut res = next.run(req).await;
res.headers_mut().remove(ALLOW);
res;
},
)) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Use |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
kkocdko
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use
axum::routing::any
, which isMethodRouter::new().fallback(handler).skip_allow_header()
inside.