Skip to content

Commit

Permalink
fix(build): fix up PR 1896
Browse files Browse the repository at this point in the history
  • Loading branch information
Awk34 committed May 25, 2016
1 parent 414b80a commit 3113a3e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions templates/app/client/components/util/util.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
};

Expand Down

0 comments on commit 3113a3e

Please sign in to comment.