Skip to content

Commit 3113a3e

Browse files
committed
fix(build): fix up PR 1896
1 parent 414b80a commit 3113a3e

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Diff for: templates/app/client/components/util/util.service.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,16 @@ function UtilService($window) {
4848
origins = origins.map(Util.urlParse);
4949
origins.push($window.location);
5050
origins = origins.filter(function(o) {
51-
return url.hostname === o.hostname &&
52-
// 2nd part of the special treatment for IE fix (see above):
53-
// 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:
54-
// https://connect.microsoft.com/IE/feedback/details/817343/ie11-scripting-value-of-htmlanchorelement-host-differs-between-script-created-link-and-link-from-document
55-
(url.port === o.port || (o.port === '' && (url.port === '80' || url.port === '443'))) &&
56-
url.protocol === o.protocol;
51+
let hostnameCheck = url.hostname === o.hostname;
52+
let protocolCheck = url.protocol === o.protocol;
53+
// 2nd part of the special treatment for IE fix (see above):
54+
// This part is when using well-known ports 80 or 443 with IE,
55+
// when $window.location.port==='' instead of the real port number.
56+
// Probably the same cause as this IE bug: https://goo.gl/J9hRta
57+
let portCheck = url.port === o.port || (o.port === '' && (url.port === '80' || url.port === '443'));
58+
return hostnameCheck && protocolCheck && portCheck;
5759
});
58-
return (origins.length >= 1);
60+
return origins.length >= 1;
5961
}
6062
};
6163

0 commit comments

Comments
 (0)