diff --git a/src/client.js b/src/client.js index 13fa5313e..1da561e75 100644 --- a/src/client.js +++ b/src/client.js @@ -113,6 +113,16 @@ try { * crypto store implementation. */ function MatrixClient(opts) { + // Allow trailing slash in HS url + if (opts.baseUrl && opts.baseUrl.endsWith("/")) { + opts.baseUrl = opts.baseUrl.substr(0, opts.baseUrl.length - 1); + } + + // Allow trailing slash in IS url + if (opts.idBaseUrl && opts.idBaseUrl.endsWith("/")) { + opts.idBaseUrl = opts.idBaseUrl.substr(0, opts.idBaseUrl.length - 1); + } + MatrixBaseApis.call(this, opts); this.reEmitter = new ReEmitter(this);