From 86ed0aac574085c2fa3ab6447401418d49c05503 Mon Sep 17 00:00:00 2001 From: homm Date: Fri, 13 Sep 2013 12:39:36 +0400 Subject: [PATCH 1/2] Fix random request aborting --- src/xdr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xdr.js b/src/xdr.js index 4273e79..66d83f5 100644 --- a/src/xdr.js +++ b/src/xdr.js @@ -20,7 +20,7 @@ if ( window.XDomainRequest ) { xdr.onerror = function() { callback( 404, "Not Found" ); }; - xdr.onprogress = jQuery.noop; + xdr.onprogress = function() {}; xdr.ontimeout = function() { callback( 0, "timeout" ); }; From bfe6da439392b8fe0b1bb7c9a023dcb4068ec23c Mon Sep 17 00:00:00 2001 From: homm Date: Fri, 13 Sep 2013 12:42:15 +0400 Subject: [PATCH 2/2] make scheme-relative urls to satisfy XDomainRequest requirements --- src/xdr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xdr.js b/src/xdr.js index 66d83f5..1eb0d1b 100644 --- a/src/xdr.js +++ b/src/xdr.js @@ -25,7 +25,7 @@ if ( window.XDomainRequest ) { callback( 0, "timeout" ); }; xdr.timeout = s.xdrTimeout || Number.MAX_VALUE; - xdr.open( s.type, s.url ); + xdr.open( s.type, s.url.replace(/^https?:/, '') ); xdr.send( ( s.hasContent && s.data ) || null ); }, abort: function() {