// Get a new xhr
var xhr = s.xhr(),
- handle;
+ 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)