diff --git a/templates/app/client/components/util/util.service.js b/templates/app/client/components/util/util.service.js index cbee2ec95..4ce50a841 100644 --- a/templates/app/client/components/util/util.service.js +++ b/templates/app/client/components/util/util.service.js @@ -48,14 +48,16 @@ function UtilService($window) { origins = origins.map(Util.urlParse); origins.push($window.location); origins = origins.filter(function(o) { - return url.hostname === o.hostname && - // 2nd part of the special treatment for IE fix (see above): - // This part is when using well-known ports 80 or 443 with IE, when $window.location.port==='' instead of the real port number. Probably the same cause as this IE bug: - // https://connect.microsoft.com/IE/feedback/details/817343/ie11-scripting-value-of-htmlanchorelement-host-differs-between-script-created-link-and-link-from-document - (url.port === o.port || (o.port === '' && (url.port === '80' || url.port === '443'))) && - url.protocol === o.protocol; + let hostnameCheck = url.hostname === o.hostname; + let protocolCheck = url.protocol === o.protocol; + // 2nd part of the special treatment for IE fix (see above): + // This part is when using well-known ports 80 or 443 with IE, + // when $window.location.port==='' instead of the real port number. + // Probably the same cause as this IE bug: https://goo.gl/J9hRta + let portCheck = url.port === o.port || (o.port === '' && (url.port === '80' || url.port === '443')); + return hostnameCheck && protocolCheck && portCheck; }); - return (origins.length >= 1); + return origins.length >= 1; } };