From 99fbd3d32c28adfd94380c6601ebb809d569c558 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Thu, 3 Mar 2022 22:33:33 +0100 Subject: [PATCH] Add note about order of extractors in the reverse-proxy example (#821) --- examples/reverse-proxy/src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/reverse-proxy/src/main.rs b/examples/reverse-proxy/src/main.rs index 3284f590..ab551e5b 100644 --- a/examples/reverse-proxy/src/main.rs +++ b/examples/reverse-proxy/src/main.rs @@ -36,7 +36,12 @@ async fn main() { .unwrap(); } -async fn handler(Extension(client): Extension, mut req: Request) -> Response { +async fn handler( + Extension(client): Extension, + // NOTE: Make sure to put the request extractor last because once the request + // is extracted, extensions can't be extracted anymore. + mut req: Request, +) -> Response { let path = req.uri().path(); let path_query = req .uri()