diff options
author | jaubourg <j@ubourg.net> | 2011-01-31 17:39:54 +0100 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2011-01-31 17:40:27 +0100 |
commit | 7c9a5e6016c2fcd38872367a891e5b3887d3df53 (patch) | |
tree | 78d630ea848573aa459a5de422813f4ac5fcc6fa /src/ajax.js | |
parent | 485fa0c42a71b4decc9cb1ce08bb56efabcc76f3 (diff) | |
download | jquery-7c9a5e6016c2fcd38872367a891e5b3887d3df53.tar.gz jquery-7c9a5e6016c2fcd38872367a891e5b3887d3df53.zip |
Makes sure all converters keys are lowercased before any conversion is taking place: dataTypes' names are now truly case insensitive. Unit test edited.
Diffstat (limited to 'src/ajax.js')
-rw-r--r-- | src/ajax.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/ajax.js b/src/ajax.js index 11eacee71..39abe9059 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -842,8 +842,9 @@ function ajaxConvert( s, response ) { } var dataTypes = s.dataTypes, - converters = s.converters, + converters = {}, i, + key, length = dataTypes.length, tmp, // Current and previous dataTypes @@ -860,6 +861,16 @@ function ajaxConvert( s, response ) { // For each dataType in the chain for( i = 1; i < length; i++ ) { + // Create converters map + // with lowercased keys + if ( i === 1 ) { + for( key in s.converters ) { + if( typeof key === "string" ) { + converters[ key.toLowerCase() ] = s.converters[ key ]; + } + } + } + // Get the dataTypes prev = current; current = dataTypes[ i ]; |