Workaround for break in IE10-11 cross domain Patch support

Workaround for break in IE10-11 cross domain Patch support

jQuery versions 1.6.0 - 1.10.2 provided support for making cross domain Patch requests in IE10 and IE11 using the jQuery.ajax() method (assuming all client and server settings are configured correctly for CORS). 

That support broke beginning with jQuery 1.11.1-rc1. A properly configured ajax request in IE10/11 now fails with "Error: Could not complete the operation due to error 8070000c." Stepping through the relevant jQuery code shows the underlying error being thrown as -2146828218, "Permission denied".

Importantly, requests appear to continue to work fine in Chrome, Firefox, Safari and other browsers on various platforms.

Looking at the code base, jQuery 1.10.2 used the following in selecting an xhr object. (Versions 1.6.0 through 1.10.x used similar but not exact implementations.)

  1. // Create the request object
  2. // (This is still attached to ajaxSettings for backward compatibility)
  3. jQuery.ajaxSettings.xhr = window.ActiveXObject ?
  4. /* Microsoft failed to properly
  5. * implement the XMLHttpRequest in IE7 (can't request local files),
  6. * so we use the ActiveXObject when it is available
  7. * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
  8. * we need a fallback.
  9. */
  10. function() {
  11. return !this.isLocal && createStandardXHR() || createActiveXHR();
  12. } :
  13. // For all other browsers, use the standard XMLHttpRequest object
  14. createStandardXHR;

jQuery 1.11.1 changed the implementation:

  1. // Create the request object
  2. // (This is still attached to ajaxSettings for backward compatibility)
  3. jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
  4. // Support: IE6+
  5. function() {

  6. // XHR cannot access local files, always use ActiveX for that case
  7. return !this.isLocal &&

  8. // Support: IE7-8
  9. // oldIE XHR does not support non-RFC2616 methods (#13240)
  10. // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
  11. // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
  12. // Although this check for six methods instead of eight
  13. // since IE also does not support "trace" and "connect"
  14. /^(get|post|head|put|delete|options)$/i.test( this.type ) &&

  15. createStandardXHR() || createActiveXHR();
  16. } :
  17. // For all other browsers, use the standard XMLHttpRequest object
  18. createStandardXHR;

The breaking difference appears to be the addition of  /^(get|post|head|put|delete|options)$/i.test( this.type ).

My question is two-fold.

First, is there a jQuery setting I can set or change in making cross domain Patch requests that will prevent the error from occurring? I understand I can revert to version 1.10.2 or modify and serve my own version of jQuery 1.11.x but both of these options are undesirable.

Second, I'm not sure I understand why "patch" is omitted from the list of items in the string above. Was it perhaps an oversight, leading to a bug? Or is it a justifiable omission?

Any help or thoughts would be greatly appreciated.