From e6c93530e257c9a0e7cbe08248ec19343d56dffa Mon Sep 17 00:00:00 2001
From: Kegan Dougal <kegan@matrix.org>
Date: Mon, 1 Feb 2016 14:19:20 +0000
Subject: [PATCH] Strip trailing slashes on HS/IS URLs on register/login

---
 src/components/views/login/ServerConfig.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/components/views/login/ServerConfig.js b/src/components/views/login/ServerConfig.js
index 741f0ebc69..fe80a0d61b 100644
--- a/src/components/views/login/ServerConfig.js
+++ b/src/components/views/login/ServerConfig.js
@@ -58,7 +58,7 @@ module.exports = React.createClass({
     onHomeserverChanged: function(ev) {
         this.setState({hs_url: ev.target.value}, function() {
             this._hsTimeoutId = this._waitThenInvoke(this._hsTimeoutId, function() {
-                this.props.onHsUrlChanged(this.state.hs_url);
+                this.props.onHsUrlChanged(this.state.hs_url.replace(/\/$/, ""));
             });
         });
     },
@@ -66,7 +66,7 @@ module.exports = React.createClass({
     onIdentityServerChanged: function(ev) {
         this.setState({is_url: ev.target.value}, function() {
             this._isTimeoutId = this._waitThenInvoke(this._isTimeoutId, function() {
-                this.props.onIsUrlChanged(this.state.is_url);
+                this.props.onIsUrlChanged(this.state.is_url.replace(/\/$/, ""));
             });
         });
     },
-- 
GitLab