aboutsummaryrefslogtreecommitdiffstats
path: root/src/ajax/xhr.js
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2011-02-02 21:16:26 +0100
committerjaubourg <j@ubourg.net>2011-02-02 21:16:26 +0100
commit5ef7ddc4c55f49cb7767bba99975f2c7ea5422d9 (patch)
tree17fbbd7cf0ec1147af4e360a948d48f7047380b4 /src/ajax/xhr.js
parente3cc440934fcb03bfeb10fb6281615409ad6f483 (diff)
downloadjquery-5ef7ddc4c55f49cb7767bba99975f2c7ea5422d9.tar.gz
jquery-5ef7ddc4c55f49cb7767bba99975f2c7ea5422d9.zip
Fixes #8146 by introducing the xhrFields option with is a map of fieldName/fieldValue to set on the native xhr. Can be used to set withCredentials to true for cross-domain requests if needed.
Diffstat (limited to 'src/ajax/xhr.js')
-rw-r--r--src/ajax/xhr.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ajax/xhr.js b/src/ajax/xhr.js
index c0368b957..3acdc66a6 100644
--- a/src/ajax/xhr.js
+++ b/src/ajax/xhr.js
@@ -82,7 +82,15 @@ if ( jQuery.support.ajax ) {
// 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)