Add note about order of extractors in the reverse-proxy example (#821)

This commit is contained in:
Max Bruckner 2022-03-03 22:33:33 +01:00 committed by GitHub
parent 1c8f09268b
commit 99fbd3d32c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()