Skip to content
Snippets Groups Projects
Commit 7ca6d4e8 authored by Matthew Hodgson's avatar Matthew Hodgson
Browse files

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

parent 2b7918bd
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,10 @@ angular.module('LoginController', ['matrixService']) ...@@ -7,7 +7,10 @@ angular.module('LoginController', ['matrixService'])
// Assume that this is hosted on the home server, in which case the URL // Assume that this is hosted on the home server, in which case the URL
// contains the home server. // contains the home server.
var hs_url = $location.protocol() + "://" + $location.host(); 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(); hs_url += ":" + $location.port();
} }
var example_domain = $location.host(); var example_domain = $location.host();
......
...@@ -8,7 +8,10 @@ angular.module('RegisterController', ['matrixService']) ...@@ -8,7 +8,10 @@ angular.module('RegisterController', ['matrixService'])
// Assume that this is hosted on the home server, in which case the URL // Assume that this is hosted on the home server, in which case the URL
// contains the home server. // contains the home server.
var hs_url = $location.protocol() + "://" + $location.host(); 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(); hs_url += ":" + $location.port();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment