diff options
author | dmethvin <dave.methvin@gmail.com> | 2010-10-23 13:23:51 -0400 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2010-10-25 13:06:02 -0700 |
commit | 09022e0b09db71259751e7146bb64727615028af (patch) | |
tree | ab66b56d49258aaa9ac2acdd963a47f10d8619a7 /src | |
parent | 974b5aeab7a3788ff5fb9db87b9567784e0249fc (diff) | |
download | jquery-09022e0b09db71259751e7146bb64727615028af.tar.gz jquery-09022e0b09db71259751e7146bb64727615028af.zip |
Allow DELETE requests to have a content body, and properly serialize data to the url for HEAD requests. Fixes #7285.
Diffstat (limited to 'src')
-rw-r--r-- | src/ajax.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ajax.js b/src/ajax.js index 915bbaa3e..6a757eb11 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -4,7 +4,7 @@ var jsc = jQuery.now(), rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, rselectTextarea = /^(?:select|textarea)/i, rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, - rnoContent = /^(?:GET|HEAD|DELETE)$/, + rnoContent = /^(?:GET|HEAD)$/, rbracket = /\[\]$/, jsre = /\=\?(&|$)/, rquery = /\?/, @@ -271,7 +271,7 @@ jQuery.extend({ s.cache = false; } - if ( s.cache === false && type === "GET" ) { + if ( s.cache === false && noContent ) { var ts = jQuery.now(); // try replacing _= if it is there @@ -281,8 +281,8 @@ jQuery.extend({ s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : ""); } - // If data is available, append data to url for get requests - if ( s.data && type === "GET" ) { + // If data is available, append data to url for GET/HEAD requests + if ( s.data && noContent ) { s.url += (rquery.test(s.url) ? "&" : "?") + s.data; } |