From bd699cb17b6347a414c0c6d105ef80a4ea1ed678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski?= Date: Tue, 19 May 2015 14:06:15 +0200 Subject: [PATCH] Ajax: Fix the XHR fallback logic for IE8 The logic for IE8 has been incorrectly reversed: every non-local request outside of the whitelist was run via the native XHR. This commit reverses this logic and adds back a fallback to the ActiveX XHR if the native one fails even after the regex detection. Refs 61f812b7e7b88dd6e0078c241e4c88905ea51562 --- src/ajax/xhr.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ajax/xhr.js b/src/ajax/xhr.js index 7c6126aa2..585703f44 100644 --- a/src/ajax/xhr.js +++ b/src/ajax/xhr.js @@ -31,11 +31,8 @@ jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ? // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9 // Although this check for six methods instead of eight // since IE also does not support "trace" and "connect" - if ( /^(get|post|head|put|delete|options)$/i.test( this.type ) ) { - return createActiveXHR(); - } - - return createStandardXHR(); + return /^(get|post|head|put|delete|options)$/i.test( this.type ) && + createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR;