- executeOnly = structure === prefilters,
- selected;
-
- for(; i < length && !( executeOnly ? typeof selected === "string" && !tested[ selected ] : selected ); i++ ) {
- selected = list[ i ]( options, originalOptions );
+ executeOnly = ( structure === prefilters ),
+ selection;
+
+ for(; i < length && ( executeOnly || !selection ); i++ ) {
+ selection = list[ i ]( options, originalOptions );
+ // If we got redirected to another dataType
+ // we try there if not done already
+ if ( typeof selection === "string" ) {
+ if ( inspected[ selection ] ) {
+ selection = undefined;
+ } else {
+ options.dataTypes.unshift( selection );
+ selection = inspectPrefiltersOrTransports(
+ structure, options, originalOptions, selection, inspected );
+ }
+ }