diff options
author | Oleg <markelog@gmail.com> | 2013-12-22 08:53:19 +0400 |
---|---|---|
committer | Oleg <markelog@gmail.com> | 2014-01-14 00:38:38 +0400 |
commit | 06ee2c16f1c466a77fb25e07991e5adaa3385656 (patch) | |
tree | b9359a85fa5162faa042845d0badd5ad61b9c7f3 /src | |
parent | f1af3c23f9fbef69b69868773fd01b4950ae2f9f (diff) | |
download | jquery-06ee2c16f1c466a77fb25e07991e5adaa3385656.tar.gz jquery-06ee2c16f1c466a77fb25e07991e5adaa3385656.zip |
Ajax: support non-RFC2616 methods for oldIE
Closes gh-1466
Fixes #13240
Diffstat (limited to 'src')
-rw-r--r-- | src/ajax/xhr.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/ajax/xhr.js b/src/ajax/xhr.js index d747093d5..0f560f45a 100644 --- a/src/ajax/xhr.js +++ b/src/ajax/xhr.js @@ -8,9 +8,20 @@ define([ // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ? // Support: IE6+ - // XHR cannot access local files, always use ActiveX for that case function() { - return !this.isLocal && createStandardXHR() || createActiveXHR(); + + // XHR cannot access local files, always use ActiveX for that case + return !this.isLocal && + + // Support: IE7-8 + // oldIE XHR does not support non-RFC2616 methods (#13240) + // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx + // 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" + /^(get|post|head|put|delete|options)$/i.test( this.type ) && + + createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; |