From 38a32d176bc0d0493ec46c2a625d2a5f86ea33ee Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Fri, 14 Aug 2020 00:45:21 +0200 Subject: [PATCH] add a slash before room if there is no other separator --- src/message.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/message.rs b/src/message.rs index 55fe645b5..034a3eb99 100644 --- a/src/message.rs +++ b/src/message.rs @@ -649,7 +649,18 @@ impl Message { if instance.contains("$ROOM") { instance.replace("$ROOM", &room) } else { - format!("{}{}", instance, room) + // if there nothing that would separate the room, add a slash as a separator + // this way, urls can be given as "https://meet.jit.si" as well as "https://meet.jit.si/" + let maybe_slash = if instance.ends_with("/") + || instance.ends_with("?") + || instance.ends_with("#") + || instance.ends_with("=") + { + "" + } else { + "/" + }; + format!("{}{}{}", instance, maybe_slash, room) } }