From 5fdcc5e77e874c4cb3758a6fb31ac76c2ca30b45 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 12 Jul 2018 15:59:23 +0100 Subject: [PATCH] Remove trailing slashes from appservice url --- .../matrix-org/dendrite/common/config/appservice.go | 5 +++++ 1 file changed, 5 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 178788e3c..e9e0158d5 100644 --- a/src/github.com/matrix-org/dendrite/common/config/appservice.go +++ b/src/github.com/matrix-org/dendrite/common/config/appservice.go @@ -188,6 +188,11 @@ func checkErrors(config *Dendrite) (err error) { } } + // Check if the url has trailing /'s. If so, remove them + for strings.HasSuffix(appservice.URL, "/") { + appservice.URL = strings.TrimSuffix(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] {