Fixes a bug that prevented headers from being set in an ajaxSend callback. Unit test modified.

This commit is contained in:
jaubourg 2011-02-07 16:35:32 +01:00
parent 0c21c83e96
commit a2dbdc1f54
2 changed files with 14 additions and 7 deletions

View file

@ -684,8 +684,7 @@ jQuery.extend({
if ( !transport ) {
done( -1, "No Transport" );
} else {
// Set state as sending
state = jqXHR.readyState = 1;
jqXHR.readyState = 1;
// Send global event
if ( fireGlobals ) {
globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
@ -698,6 +697,7 @@ jQuery.extend({
}
try {
state = 1;
transport.send( requestHeaders, done );
} catch (e) {
// Propagate exception as error if not done