mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-08 00:00:24 +02:00
Add note about order of extractors in the reverse-proxy example (#821)
This commit is contained in:
@@ -36,7 +36,12 @@ async fn main() {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn handler(Extension(client): Extension<Client>, mut req: Request<Body>) -> Response<Body> {
|
async fn handler(
|
||||||
|
Extension(client): Extension<Client>,
|
||||||
|
// NOTE: Make sure to put the request extractor last because once the request
|
||||||
|
// is extracted, extensions can't be extracted anymore.
|
||||||
|
mut req: Request<Body>,
|
||||||
|
) -> Response<Body> {
|
||||||
let path = req.uri().path();
|
let path = req.uri().path();
|
||||||
let path_query = req
|
let path_query = req
|
||||||
.uri()
|
.uri()
|
||||||
|
|||||||
Reference in New Issue
Block a user