aboutsummaryrefslogtreecommitdiffstats
path: root/src/ajax.js
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2011-04-19 00:29:20 -0700
committerjaubourg <j@ubourg.net>2011-04-19 00:29:20 -0700
commit3a3842c6696f121392c89b68f2f061043405ae9f (patch)
treea0bfbef4105cab7672c9ebc6788043444bd60d2c /src/ajax.js
parent8d3754751dfa348c1d1e2d6735ec8cbc3a404695 (diff)
downloadjquery-3a3842c6696f121392c89b68f2f061043405ae9f.tar.gz
jquery-3a3842c6696f121392c89b68f2f061043405ae9f.zip
(Re) Fixes #8884 in a way that keeps the format of the headers map sent to transports natural.
Diffstat (limited to 'src/ajax.js')
-rw-r--r--src/ajax.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ajax.js b/src/ajax.js
index 4f8fee6c1..a16717b00 100644
--- a/src/ajax.js
+++ b/src/ajax.js
@@ -95,7 +95,7 @@ function addToPrefiltersOrTransports( structure ) {
};
}
-//Base inspection function for prefilters and transports
+// Base inspection function for prefilters and transports
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
dataType /* internal */, inspected /* internal */ ) {
@@ -389,6 +389,7 @@ jQuery.extend({
ifModifiedKey,
// Headers (they are sent all at once)
requestHeaders = {},
+ requestHeadersNames = {},
// Response headers
responseHeadersString,
responseHeaders,
@@ -412,7 +413,9 @@ jQuery.extend({
// 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;
},