[fractal] Automatically append a "/" to the user-specified server URL.



commit ba507248aeb4cd6abfa4905f19cb7c8a4d92fb56
Author: Nils Asmussen <nils os inf tu-dresden de>
Date:   Sat Feb 29 16:37:09 2020 +0100

    Automatically append a "/" to the user-specified server URL.
    
    Since a trailing slash is important to not overwrite the last path
    component, it should be automatically appended.

 fractal-gtk/src/widgets/login.rs | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/fractal-gtk/src/widgets/login.rs b/fractal-gtk/src/widgets/login.rs
index f9fb75ef..615737e4 100644
--- a/fractal-gtk/src/widgets/login.rs
+++ b/fractal-gtk/src/widgets/login.rs
@@ -90,6 +90,7 @@ impl LoginWidget {
                 } else {
                     format!("https://{}";, &txt)
                 };
+                let txt = if !txt.ends_with("/") { txt + "/" } else { txt };
 
                 if !password.is_empty() && !username.is_empty() {
                     // take the user's homeserver value if the


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]