mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-23 00:00:15 +02:00
PoC of introducing SpoofableValue
PoC to check which solution to pick for https://github.com/tokio-rs/axum/issues/2998
This commit is contained in:
@@ -122,7 +122,7 @@ where
|
||||
}
|
||||
|
||||
let redirect = move |Host(host): Host, uri: Uri| async move {
|
||||
match make_https(host, uri, ports) {
|
||||
match make_https(host.spoofable_value(), uri, ports) {
|
||||
Ok(uri) => Ok(Redirect::permanent(&uri.to_string())),
|
||||
Err(error) => {
|
||||
tracing::warn!(%error, "failed to convert URI to HTTPS");
|
||||
|
||||
@@ -88,7 +88,7 @@ async fn redirect_http_to_https(ports: Ports) {
|
||||
}
|
||||
|
||||
let redirect = move |Host(host): Host, uri: Uri| async move {
|
||||
match make_https(host, uri, ports) {
|
||||
match make_https(host.spoofable_value(), uri, ports) {
|
||||
Ok(uri) => Ok(Redirect::permanent(&uri.to_string())),
|
||||
Err(error) => {
|
||||
tracing::warn!(%error, "failed to convert URI to HTTPS");
|
||||
|
||||
Reference in New Issue
Block a user