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:
Yann Simon
2024-10-20 12:52:34 +02:00
parent ffeb4f9407
commit 591d9c9ca5
5 changed files with 32 additions and 14 deletions
+1 -1
View File
@@ -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");
+1 -1
View File
@@ -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");