Skip to content

Commit

Permalink
Additional cross-domain fixes related to IE8 in compatibility
Browse files Browse the repository at this point in the history
mode (thanks to @dankohn and @blargoner)
  • Loading branch information
Leif Gustafson committed Jul 30, 2015
1 parent d41edc8 commit 3d58ddd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/rails.js
Expand Up @@ -189,11 +189,12 @@
// This is a workaround to a IE bug.
urlAnchor.href = urlAnchor.href;

// If URL protocol *and* host are false, assume it is not a
// cross-domain request (should only be the case for IE7 and IE
// compatibility mode). Otherwise, evaluate protocol and host of the
// URL against the origin protocol and host
return !((!urlAnchor.protocol && !urlAnchor.host) ||
// If URL protocol is false or is a string containing a single colon
// *and* host are false, assume it is not a cross-domain request
// (should only be the case for IE7 and IE compatibility mode).
// Otherwise, evaluate protocol and host of the URL against the origin
// protocol and host
return !(((!urlAnchor.protocol || urlAnchor.protocol === ':') && !urlAnchor.host) ||
(originAnchor.protocol + "//" + originAnchor.host ===
urlAnchor.protocol + "//" + urlAnchor.host));
} catch (e) {
Expand Down

0 comments on commit 3d58ddd

Please sign in to comment.