aboutsummaryrefslogtreecommitdiff
path: root/src/post.rs
diff options
context:
space:
mode:
authorShav Kinderlehrer <[email protected]>2024-05-01 12:32:28 -0400
committerShav Kinderlehrer <[email protected]>2024-05-01 12:32:28 -0400
commita4cfb64155c7505f32fed0a579d41101e544fa7c (patch)
tree98e3d76fb06b8e71c545c4a17c6a4c4e9f61f4df /src/post.rs
parent84f5f57adea7f28e2f445f088779fa78ecfb1733 (diff)
downloadchela-a4cfb64155c7505f32fed0a579d41101e544fa7c.tar.gz
chela-a4cfb64155c7505f32fed0a579d41101e544fa7c.zip
Add CHELA_USES_HTTPS as an optionHEADv1.4.0main
Diffstat (limited to 'src/post.rs')
-rw-r--r--src/post.rs6
1 files changed, 4 insertions, 2 deletions
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#"<pre>http://{}/{} -> <a href="{}"">{}</a></pre>"#,
+ r#"<pre>http{}://{}/{} -> <a href="{}"">{}</a></pre>"#,
+ 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#"<pre>http://{}/{} -> <a href="{}"">{}</a></pre>"#,
+ r#"<pre>http{}://{}/{} -> <a href="{}"">{}</a></pre>"#,
+ if state.uses_https { "s" } else { "" },
state.host,
id.id,
form.url.as_str(),