Skip to content

Commit

Permalink
Only add https:// if not present
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerboa-app committed Oct 28, 2024
1 parent aab7bb0 commit 4a6e43f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/content/error_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ impl ErrorPage
{
fn expand_template(template: String, config: &Config) -> String
{
template.replace("LINK_TO_HOME", &format!("https://{}",&config.domain))
let mut domain = config.domain.to_string();
if !domain.starts_with("https://") {domain = format!("https://{domain}")}
template.replace("LINK_TO_HOME", &domain)
}

pub fn expand_error_code(&self, code: &str) -> String
Expand Down

0 comments on commit 4a6e43f

Please sign in to comment.