From 3ac23f90631736c325dcb624c8a5be31accaf022 Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Mon, 16 Jul 2018 08:16:01 -0700 Subject: [PATCH] Remove trailing slashes from appservice url (#546) * Remove trailing slashes from appservice url * Use TrimRight instead --- src/github.com/matrix-org/dendrite/common/config/appservice.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/github.com/matrix-org/dendrite/common/config/appservice.go b/src/github.com/matrix-org/dendrite/common/config/appservice.go index 2b47eb58d..a18d716e4 100644 --- a/src/github.com/matrix-org/dendrite/common/config/appservice.go +++ b/src/github.com/matrix-org/dendrite/common/config/appservice.go @@ -236,6 +236,9 @@ func checkErrors(config *Dendrite) (err error) { } } + // Check if the url has trailing /'s. If so, remove them + appservice.URL = strings.TrimRight(appservice.URL, "/") + // Check if we've already seen this ID. No two application services // can have the same ID or token. if idMap[appservice.ID] {