Commit 823eecab authored by jaubourg's avatar jaubourg

Fixes #8146. Custom fields in xhrFields are now set after the XMLHttpRequest...

Fixes #8146. Custom fields in xhrFields are now set after the XMLHttpRequest object has been opened.
parent d77a2a22
...@@ -85,13 +85,6 @@ if ( jQuery.support.ajax ) { ...@@ -85,13 +85,6 @@ if ( jQuery.support.ajax ) {
handle, handle,
i; i;
// Apply custom fields if provided
if ( s.xhrFields ) {
for ( i in s.xhrFields ) {
xhr[ i ] = s.xhrFields[ i ];
}
}
// Open the socket // Open the socket
// Passing null username, generates a login popup on Opera (#2865) // Passing null username, generates a login popup on Opera (#2865)
if ( s.username ) { if ( s.username ) {
...@@ -100,6 +93,13 @@ if ( jQuery.support.ajax ) { ...@@ -100,6 +93,13 @@ if ( jQuery.support.ajax ) {
xhr.open( s.type, s.url, s.async ); 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 // Requested-With header
// Not set for crossDomain requests with no content // Not set for crossDomain requests with no content
// (see why at http://trac.dojotoolkit.org/ticket/9486) // (see why at http://trac.dojotoolkit.org/ticket/9486)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment