mirror of
https://github.com/tokio-rs/axum.git
synced 2024-11-21 22:56:46 +01:00
Add note about order of extractors in the reverse-proxy example (#821)
This commit is contained in:
parent
1c8f09268b
commit
99fbd3d32c
1 changed files with 6 additions and 1 deletions
|
@ -36,7 +36,12 @@ async fn main() {
|
|||
.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_query = req
|
||||
.uri()
|
||||
|
|
Loading…
Reference in a new issue