Skip to content
Permalink
Browse files

Fix #11586. Ajax DELETE ain't got no body, so data goes to its URL.

  • Loading branch information...
dmethvin committed Aug 24, 2012
1 parent a9c2a9b commit c01e022f33575ed45fb8da65be756fc464d40a24
Showing with 16 additions and 1 deletion.
  1. +1 −1 src/ajax.js
  2. +15 −0 test/unit/ajax.js
@@ -7,7 +7,7 @@ var // Document location
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
// #7653, #8125, #8152: local protocol detection
rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
rnoContent = /^(?:GET|HEAD)$/,
rnoContent = /^(?:GET|HEAD|DELETE)$/,
rprotocol = /^\/\//,
rquery = /\?/,
rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
@@ -840,6 +840,21 @@ test("jQuery.ajax - HEAD requests", function() {

});


test("jQuery.ajax - DELETE requests", function() {
expect(1);

jQuery.ajax({
url: "devo.html",
type: "DELETE",
data: { "whip": "it", "qty": "good" },
beforeSend: function( _ , s ) {
equal( s.url, "devo.html?whip=it&qty=good", "Delete requests encode data in URL" );
return false;
}
});
});

test("jQuery.ajax - beforeSend", function() {
expect(1);
stop();

0 comments on commit c01e022

Please sign in to comment.
You can’t perform that action at this time.