From a4cfb64155c7505f32fed0a579d41101e544fa7c Mon Sep 17 00:00:00 2001 From: Shav Kinderlehrer Date: Wed, 1 May 2024 12:32:28 -0400 Subject: Add CHELA_USES_HTTPS as an option --- src/post.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/post.rs') diff --git a/src/post.rs b/src/post.rs index e19d6ae..bac5c06 100644 --- a/src/post.rs +++ b/src/post.rs @@ -32,7 +32,8 @@ pub async fn create_link( if id.exists { log!("Serving cached id {} -> {}", id.id, form.url.as_str()); return Html(format!( - r#"
http://{}/{} -> {}
"#, + r#"
http{}://{}/{} -> {}
"#, + if state.uses_https { "s" } else { "" }, state.host, id.id, form.url.as_str(), @@ -72,7 +73,8 @@ VALUES ($1,$2,true) return ( StatusCode::OK, Html(format!( - r#"
http://{}/{} -> {}
"#, + r#"
http{}://{}/{} -> {}
"#, + if state.uses_https { "s" } else { "" }, state.host, id.id, form.url.as_str(), -- cgit v1.2.3