Fixes #7868. ResponseText is now properly propagated for error callbacks.

This commit is contained in:
jaubourg 2011-01-09 04:53:29 +01:00
parent 69497c3fd7
commit d515068ee8
4 changed files with 34 additions and 9 deletions

View file

@ -0,0 +1,5 @@
<?php
header("HTTP/1.0 400 Bad Request");
echo "plain text message";

View file

@ -240,6 +240,23 @@ test("jQuery.ajax() - error callbacks", function() {
});
});
test("jQuery.ajax() - responseText on error", function() {
expect( 1 );
stop();
jQuery.ajax({
url: url("data/errorWithText.php"),
error: function(xhr) {
strictEqual( xhr.responseText , "plain text message" , "Test jXHR.responseText is filled for HTTP errors" );
},
complete: function() {
start();
}
});
});
test(".ajax() - headers" , function() {
expect( 2 );