From: Ian Jackson Date: Sun, 22 Nov 2020 10:33:33 +0000 (+0000) Subject: tidy public_url a bit X-Git-Tag: otter-0.2.0~407 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=007c6995cd1bf7284d3781503b41807505e3a4e4;p=otter.git tidy public_url a bit Signed-off-by: Ian Jackson --- diff --git a/src/config.rs b/src/config.rs index 241ca097..861fbd00 100644 --- a/src/config.rs +++ b/src/config.rs @@ -67,6 +67,10 @@ impl TryFrom for ServerConfig { command_socket = format!("{}/{}", save_directory, command_socket); } + let public_url = public_url + .trim_end_matches('/') + .into(); + let debug = debug.unwrap_or(cfg!(debug_assertions)); let rocket_workers = rocket_workers.unwrap_or( if debug { 20 } else { 1000 }); @@ -134,7 +138,7 @@ impl ServerConfig { impl Default for ServerConfig { fn default() -> ServerConfig { let spec : ServerConfigSpec = toml_de::from_str(r#" - public_url = "XXX" + public_url = "INTERNAL ERROR" "#) .expect("parse dummy config as ServerConfigSpec"); spec.try_into().expect("empty spec into config")