rselectTextarea = /^(?:select|textarea)/i,
rspacesAjax = /\s+/,
rts = /([?&])_=[^&]*/,
- rucHeaders = /(^|\-)([a-z])/g,
- rucHeadersFunc = function( _, $1, $2 ) {
- return $1 + $2.toUpperCase();
- },
rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
// Keep a copy of the old load method
// Caches the header
setRequestHeader: function( name, value ) {
if ( !state ) {
- requestHeaders[ name.toUpperCase().replace( rucHeaders, rucHeadersFunc ) ] = { name: name, value: value };
+ requestHeaders[ name.toLowerCase() ] = { n: name, v: value };
}
return this;
},
}
// Set the Accepts header for the server, depending on the dataType
- jqXHR.setRequestHeader(
- "Accept",
- s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
- s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) :
- s.accepts[ "*" ]
- );
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
// Check for headers option
for ( i in s.headers ) {
// Need an extra try/catch for cross domain requests in Firefox 3
try {
for ( i in headers ) {
- xhr.setRequestHeader( headers[ i ].name, headers[ i ].value );
+ xhr.setRequestHeader( headers[ i ].n, headers[ i ].v );
}
} catch( _ ) {}