Skip to content

Commit 35bc16e

Browse files
author
Jakub Szwacz
committed
Pass cookies across domains
1 parent 43b0f45 commit 35bc16e

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/server/ajax.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ filepicker.extend('ajax', function(){
7272
var data = options.data || null;
7373
var processData = options.processData === undefined ? true : options.processData;
7474
var headers = options.headers || {};
75-
75+
7676
var urlParts = fp.util.parseUrl(url);
7777
var origin = window.location.protocol + '//' + window.location.host;
7878
var crossdomain = origin !== urlParts.origin;
@@ -170,7 +170,9 @@ filepicker.extend('ajax', function(){
170170
url += (url.indexOf('?') !== -1 ? '&' : '?') + data;
171171
data = null;
172172
}
173-
173+
174+
xhr.withCredentials = true;
175+
174176
xhr.open(method, url, async);
175177
if (options.json) {
176178
xhr.setRequestHeader('Accept', 'application/json, text/javascript');
@@ -189,7 +191,7 @@ filepicker.extend('ajax', function(){
189191
}
190192
}
191193

192-
xhr.send(data);
194+
xhr.send(data);
193195

194196
return xhr;
195197
};
@@ -237,7 +239,7 @@ filepicker.extend('ajax', function(){
237239
url += (url.indexOf('?') >= 0 ? '&' : '?') + data;
238240
data = null;
239241
}
240-
242+
241243
//so we know it's an xdr and can handle appropriately
242244
url += (url.indexOf('?') >= 0 ? '&' : '?') + '_xdr=true&_cacheBust='+fp.util.getId();
243245

0 commit comments

Comments
 (0)