Ensures dataTypeExpressions are lowercased for prefilters and transports registrations.

This commit is contained in:
jaubourg 2011-01-31 10:13:54 +01:00
parent 945ac0d0b1
commit 91ca71daaa

View file

@ -48,7 +48,7 @@ function addToPrefiltersOrTransports( structure ) {
} }
if ( jQuery.isFunction( func ) ) { if ( jQuery.isFunction( func ) ) {
var dataTypes = dataTypeExpression.split( rspacesAjax ), var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
i = 0, i = 0,
length = dataTypes.length, length = dataTypes.length,
dataType, dataType,
@ -62,7 +62,7 @@ function addToPrefiltersOrTransports( structure ) {
// any existing element // any existing element
placeBefore = /^\+/.test( dataType ); placeBefore = /^\+/.test( dataType );
if ( placeBefore ) { if ( placeBefore ) {
dataType = dataType.substr( 1 ); dataType = dataType.substr( 1 ) || "*";
} }
list = structure[ dataType ] = structure[ dataType ] || []; list = structure[ dataType ] = structure[ dataType ] || [];
// then we add to the structure accordingly // then we add to the structure accordingly