Skip to content

Commit

Permalink
Revert "Use OriginalUri extractor"
Browse files Browse the repository at this point in the history
This reverts commit 000e3b7.
  • Loading branch information
Benjamin Sparks committed Mar 15, 2024
1 parent 000e3b7 commit 48a718d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions axum/src/extract/scheme.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::{
rejection::{FailedToResolveScheme, SchemeRejection},
FromRequestParts, OriginalUri,
FromRequestParts,
};
use async_trait::async_trait;
use http::{
Expand Down Expand Up @@ -28,7 +28,7 @@ where
{
type Rejection = SchemeRejection;

async fn from_request_parts(parts: &mut Parts, state: &S) -> Result<Self, Self::Rejection> {
async fn from_request_parts(parts: &mut Parts, _state: &S) -> Result<Self, Self::Rejection> {
// Within Forwarded header
if let Some(scheme) = parse_forwarded(&parts.headers) {
return Ok(Scheme(scheme.to_owned()));
Expand All @@ -43,9 +43,8 @@ where
return Ok(Scheme(scheme.to_owned()));
}

// From parts; Infallible conversion
let original = OriginalUri::from_request_parts(parts, state).await.unwrap();
if let Some(scheme) = original.scheme_str() {
// From parts
if let Some(scheme) = parts.uri.scheme_str() {
return Ok(Scheme(scheme.to_owned()));
}

Expand Down

0 comments on commit 48a718d

Please sign in to comment.