summary refs log tree commit diff
path: root/webclient
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2014-08-31 15:38:27 +0100
committerMatthew Hodgson <matthew@matrix.org>2014-08-31 15:38:27 +0100
commit7ca6d4e8f7651f570196c92c94f9ca4a6b2c0e74 (patch)
tree93d0a7dfeca0b6f830812f98da90c004745fb415 /webclient
parentmissed a s#/matrix#/_matrix/g (diff)
downloadsynapse-7ca6d4e8f7651f570196c92c94f9ca4a6b2c0e74.tar.xz
don't make HS ports explicit if it's the default for the protocol
Diffstat (limited to 'webclient')
-rw-r--r--webclient/login/login-controller.js5
-rw-r--r--webclient/login/register-controller.js5
2 files changed, 8 insertions, 2 deletions
diff --git a/webclient/login/login-controller.js b/webclient/login/login-controller.js
index 2b91926954..af9a61f0f0 100644
--- a/webclient/login/login-controller.js
+++ b/webclient/login/login-controller.js
@@ -7,7 +7,10 @@ angular.module('LoginController', ['matrixService'])
     // Assume that this is hosted on the home server, in which case the URL
     // contains the home server.
     var hs_url = $location.protocol() + "://" + $location.host();
-    if ($location.port()) {
+    if ($location.port() &&
+        !($location.protocol() === "http" && $location.port() === 80) &&
+        !($location.protocol() === "https" && $location.port() === 443))
+    {
         hs_url += ":" + $location.port();
     }
     var example_domain = $location.host();
diff --git a/webclient/login/register-controller.js b/webclient/login/register-controller.js
index 6c1bfd632a..d4fb9add70 100644
--- a/webclient/login/register-controller.js
+++ b/webclient/login/register-controller.js
@@ -8,7 +8,10 @@ angular.module('RegisterController', ['matrixService'])
     // Assume that this is hosted on the home server, in which case the URL
     // contains the home server.
     var hs_url = $location.protocol() + "://" + $location.host();
-    if ($location.port()) {
+    if ($location.port() &&
+        !($location.protocol() === "http" && $location.port() === 80) &&
+        !($location.protocol() === "https" && $location.port() === 443))
+    {
         hs_url += ":" + $location.port();
     }