};
}
-//Base inspection function for prefilters and transports
+// Base inspection function for prefilters and transports
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
dataType /* internal */, inspected /* internal */ ) {
ifModifiedKey,
// Headers (they are sent all at once)
requestHeaders = {},
+ requestHeadersNames = {},
// Response headers
responseHeadersString,
responseHeaders,
// Caches the header
setRequestHeader: function( name, value ) {
if ( !state ) {
- requestHeaders[ name.toLowerCase() ] = { n: name, v: value };
+ var lname = name.toLowerCase();
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+ requestHeaders[ name ] = value;
}
return this;
},
// Need an extra try/catch for cross domain requests in Firefox 3
try {
for ( i in headers ) {
- xhr.setRequestHeader( headers[ i ].n, headers[ i ].v );
+ xhr.setRequestHeader( i, headers[ i ] );
}
} catch( _ ) {}