mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-19 00:00:14 +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();
|
||||
}
|
||||
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user