don't make HS ports explicit if it's the default for the protocol

This commit is contained in:
Matthew Hodgson 2014-08-31 15:38:27 +01:00
parent 2b7918bd6f
commit 7ca6d4e8f7
2 changed files with 8 additions and 2 deletions

View File

@ -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();

View File

@ -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();
}