mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
This commit is contained in:
5
test/data/nocontent.php
Normal file
5
test/data/nocontent.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
header('HTTP/1.0 204 No Content');
|
||||
|
||||
?>
|
||||
@@ -1456,6 +1456,26 @@ module( "ajax", {
|
||||
strictEqual( ajaxXML.find("tab").length, 3, "Parsed node was added properly" );
|
||||
}
|
||||
});
|
||||
|
||||
ajaxTest( "#13292 - jQuery.ajax() - converter is bypassed for 204 requests", 3, {
|
||||
url: "data/nocontent.php",
|
||||
dataType: "testing",
|
||||
converters: {
|
||||
"* testing": function() {
|
||||
throw "converter was called";
|
||||
}
|
||||
},
|
||||
success: function( data, status, jqXHR ) {
|
||||
strictEqual( jqXHR.status, 204, "status code is 204" );
|
||||
strictEqual( status, "nocontent", "status text is 'nocontent'" );
|
||||
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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user