Skip to content

Commit 2f67181

Browse files
committed
Throw error on trailing slash server URL #566
1 parent 740ab5c commit 2f67181

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/src/config.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,11 @@ pub fn build_config(opts: Opts) -> AtomicServerResult<Config> {
299299

300300
// This logic could be a bit too complicated, but I'm not sure on how to make this simpler.
301301
let server_url = if let Some(addr) = opts.server_url.clone() {
302-
addr
302+
if addr.ends_with('/') {
303+
return Err("The Server URL should not end with a trailing slash.".into());
304+
} else {
305+
addr
306+
}
303307
} else if opts.https && opts.port_https == 443 || !opts.https && opts.port == 80 {
304308
format!("{}://{}", schema, opts.domain)
305309
} else {

0 commit comments

Comments
 (0)