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