File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -644,6 +644,8 @@ jQuery.extend({
644
644
// If data is available, append data to url
645
645
if ( s . data ) {
646
646
s . url += ( rquery . test ( s . url ) ? "&" : "?" ) + s . data ;
647
+ // #9682: remove data so that it's not used in an eventual retry
648
+ delete s . data ;
647
649
}
648
650
649
651
// Get ifModifiedKey before adding the anti-cache parameter
Original file line number Diff line number Diff line change @@ -321,25 +321,40 @@ test("jQuery.ajax() - responseText on error", function() {
321
321
322
322
test ( ".ajax() - retry with jQuery.ajax( this )" , function ( ) {
323
323
324
- expect ( 1 ) ;
324
+ expect ( 2 ) ;
325
325
326
326
stop ( ) ;
327
327
328
- var firstTime = 1 ;
328
+ var firstTime = true ,
329
+ previousUrl ;
329
330
330
331
jQuery . ajax ( {
331
332
url : url ( "data/errorWithText.php" ) ,
332
333
error : function ( ) {
333
334
if ( firstTime ) {
334
- firstTime = 0 ;
335
+ firstTime = false ;
335
336
jQuery . ajax ( this ) ;
336
337
} else {
337
338
ok ( true , "Test retrying with jQuery.ajax(this) works" ) ;
338
- start ( ) ;
339
+ jQuery . ajax ( {
340
+ url : url ( "data/errorWithText.php" ) ,
341
+ data : { x : 1 } ,
342
+ beforeSend : function ( ) {
343
+ if ( ! previousUrl ) {
344
+ previousUrl = this . url ;
345
+ } else {
346
+ strictEqual ( this . url , previousUrl , "url parameters are not re-appended" ) ;
347
+ start ( ) ;
348
+ return false ;
349
+ }
350
+ } ,
351
+ error : function ( ) {
352
+ jQuery . ajax ( this ) ;
353
+ }
354
+ } ) ;
339
355
}
340
356
}
341
357
} ) ;
342
-
343
358
} ) ;
344
359
345
360
test ( ".ajax() - headers" , function ( ) {
You can’t perform that action at this time.
0 commit comments