aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authordmethvin <dave.methvin@gmail.com>2010-10-23 13:23:51 -0400
committerJohn Resig <jeresig@gmail.com>2010-10-25 13:06:02 -0700
commit09022e0b09db71259751e7146bb64727615028af (patch)
treeab66b56d49258aaa9ac2acdd963a47f10d8619a7 /src
parent974b5aeab7a3788ff5fb9db87b9567784e0249fc (diff)
downloadjquery-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.js8
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;
}