mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-19 00:00:14 +02:00
Make sure nested services still see full URI (#166)
They'd previously see the nested URI as we mutated the request. Now we always route based on the nested URI (if present) without mutating the request. Also meant we could get rid of `OriginalUri` which is nice.
This commit is contained in:
+2
-6
@@ -244,7 +244,7 @@
|
||||
//!
|
||||
//! [`body::Body`]: crate::body::Body
|
||||
|
||||
use crate::{response::IntoResponse, routing::OriginalUri};
|
||||
use crate::response::IntoResponse;
|
||||
use async_trait::async_trait;
|
||||
use http::{header, Extensions, HeaderMap, Method, Request, Uri, Version};
|
||||
use rejection::*;
|
||||
@@ -378,7 +378,7 @@ impl<B> RequestParts<B> {
|
||||
let (
|
||||
http::request::Parts {
|
||||
method,
|
||||
mut uri,
|
||||
uri,
|
||||
version,
|
||||
headers,
|
||||
extensions,
|
||||
@@ -387,10 +387,6 @@ impl<B> RequestParts<B> {
|
||||
body,
|
||||
) = req.into_parts();
|
||||
|
||||
if let Some(original_uri) = extensions.get::<OriginalUri>() {
|
||||
uri = original_uri.0.clone();
|
||||
};
|
||||
|
||||
RequestParts {
|
||||
method,
|
||||
uri,
|
||||
|
||||
Reference in New Issue
Block a user