diff --git a/CONTRIBUTORS b/CONTRIBUTORS index b89c4be40..2c01107dc 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -112,6 +112,7 @@ Fabricio Duarte Mani Kaben Nanlohy Tobias Predel +Daniel Tang ******************** diff --git a/rslib/src/backend/sync/mod.rs b/rslib/src/backend/sync/mod.rs index e90a9229d..952190c42 100644 --- a/rslib/src/backend/sync/mod.rs +++ b/rslib/src/backend/sync/mod.rs @@ -86,6 +86,11 @@ impl TryFrom for SyncAuth { .endpoint .map(|v| { Url::try_from(v.as_str()) + // Without the next line, incomplete URLs like computer.local without the http:// + // are detected but URLs like computer.local:8000 are not. + // By calling join() now, these URLs are detected too and later code that + // uses and unwraps the result of join() doesn't panic + .and_then(|x| x.join("/")) .or_invalid("Invalid sync server specified. Please check the preferences.") }) .transpose()?,