diff options
author | Julian Aubourg <j@ubourg.net> | 2013-05-23 02:11:37 +0200 |
---|---|---|
committer | Julian Aubourg <j@ubourg.net> | 2013-05-23 02:11:37 +0200 |
commit | a2cd89a795067d67d8212a4571991e5d2fb0ea8f (patch) | |
tree | 09770d0cb4da93d6e53d3586d656679d10c2f32d /test | |
parent | eabb56c27484cbffd2ce4951f661df83c91e5d7a (diff) | |
download | jquery-a2cd89a795067d67d8212a4571991e5d2fb0ea8f.tar.gz jquery-a2cd89a795067d67d8212a4571991e5d2fb0ea8f.zip |
Handles HEAD requests as if they always were 204. Fixes #13922.
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/ajax.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 2dd74c384..761885ccb 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -1499,6 +1499,29 @@ module( "ajax", { } }); + ajaxTest( "#13922 - jQuery.ajax() - converter is bypassed for HEAD requests", 3, { + url: "data/json.php", + method: "HEAD", + data: { + header: "yes" + }, + converters: { + "text json": function() { + throw "converter was called"; + } + }, + success: function( data, status ) { + ok( true, "success" ); + strictEqual( status, "nocontent", "data is undefined" ); + strictEqual( data, undefined, "data is undefined" ); + }, + error: function( _, status, error ) { + ok( false, "error" ); + strictEqual( status, "parsererror", "Parser Error" ); + strictEqual( error, "converter was called", "Converter was called" ); + } + } ); + //----------- jQuery.ajaxPrefilter() ajaxTest( "jQuery.ajaxPrefilter() - abort", 1, { |