Fix Uri extractor not being the full URI if using nest (#156)

This commit is contained in:
David Pedersen
2021-08-07 22:07:50 +02:00
committed by GitHub
parent a6b3e09827
commit c570fb2d52
4 changed files with 49 additions and 2 deletions
+6 -2
View File
@@ -244,7 +244,7 @@
//!
//! [`body::Body`]: crate::body::Body
use crate::response::IntoResponse;
use crate::{response::IntoResponse, routing::OriginalUri};
use async_trait::async_trait;
use http::{header, Extensions, HeaderMap, Method, Request, Uri, Version};
use rejection::*;
@@ -377,7 +377,7 @@ impl<B> RequestParts<B> {
let (
http::request::Parts {
method,
uri,
mut uri,
version,
headers,
extensions,
@@ -386,6 +386,10 @@ impl<B> RequestParts<B> {
body,
) = req.into_parts();
if let Some(original_uri) = extensions.get::<OriginalUri>() {
uri = original_uri.0.clone();
};
RequestParts {
method,
uri,