Permalink
Browse files

Merge pull request #43 from pestig/master

CORS deteciton improve
  • Loading branch information...
2 parents afe543d + 3da8720 commit f062a06be38a3e7f3d8c7ce81977ad749eb05753 @sstrigler committed Mar 1, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/ieXDRToXHR.js
View
5 src/ieXDRToXHR.js
@@ -41,7 +41,10 @@ if (window.XDomainRequest) {
};
XMLHttpRequest.prototype.open = function(method, url, asynch, user, pwd) {
- if (url.indexOf(document.domain) < 0 && url.indexOf('http-bind') > 0) {
+ //improve CORS deteciton (chat.example.net exemple.net), remove hardcoded http-bind
+ var parser = document.createElement('a');
+ parser.href = url;
+ if (parser.hostname!=document.domain) {
if (this.xdr === null){
this.xdr = new window.XDomainRequest();
}

0 comments on commit f062a06

Please sign in to comment.