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 61f812b7e7
This commit is contained in:
Michał Gołębiowski 2015-05-19 14:06:15 +02:00
parent ef30bdf4f1
commit bd699cb17b

View File

@ -31,11 +31,8 @@ jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
// and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9 // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
// Although this check for six methods instead of eight // Although this check for six methods instead of eight
// since IE also does not support "trace" and "connect" // since IE also does not support "trace" and "connect"
if ( /^(get|post|head|put|delete|options)$/i.test( this.type ) ) { return /^(get|post|head|put|delete|options)$/i.test( this.type ) &&
return createActiveXHR(); createStandardXHR() || createActiveXHR();
}
return createStandardXHR();
} : } :
// For all other browsers, use the standard XMLHttpRequest object // For all other browsers, use the standard XMLHttpRequest object
createStandardXHR; createStandardXHR;