aboutsummaryrefslogtreecommitdiffstats
path: root/src/ajax
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2011-02-03 03:02:11 +0100
committerjaubourg <j@ubourg.net>2011-02-03 03:02:11 +0100
commit823eecab9073b43a283a2500e9e43c3a06cc2495 (patch)
tree4b2c6854399bd2a6f7d2aead79612935134ff82b /src/ajax
parentd77a2a2274d34033da8609a26c9cc1f2bd14c879 (diff)
downloadjquery-823eecab9073b43a283a2500e9e43c3a06cc2495.tar.gz
jquery-823eecab9073b43a283a2500e9e43c3a06cc2495.zip
Fixes #8146. Custom fields in xhrFields are now set after the XMLHttpRequest object has been opened.
Diffstat (limited to 'src/ajax')
-rw-r--r--src/ajax/xhr.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ajax/xhr.js b/src/ajax/xhr.js
index d4c291fcb..4adf8eb2a 100644
--- a/src/ajax/xhr.js
+++ b/src/ajax/xhr.js
@@ -85,13 +85,6 @@ if ( jQuery.support.ajax ) {
handle,
i;
- // Apply custom fields if provided
- if ( s.xhrFields ) {
- for ( i in s.xhrFields ) {
- xhr[ i ] = s.xhrFields[ i ];
- }
- }
-
// Open the socket
// Passing null username, generates a login popup on Opera (#2865)
if ( s.username ) {
@@ -100,6 +93,13 @@ if ( jQuery.support.ajax ) {
xhr.open( s.type, s.url, s.async );
}
+ // Apply custom fields if provided
+ if ( s.xhrFields ) {
+ for ( i in s.xhrFields ) {
+ xhr[ i ] = s.xhrFields[ i ];
+ }
+ }
+
// Requested-With header
// Not set for crossDomain requests with no content
// (see why at http://trac.dojotoolkit.org/ticket/9486)