Skip to content

Commit

Permalink
- CORS (Cross-origin resource sharing) support
Browse files Browse the repository at this point in the history
- Ability to pass custom HTTP headers
  • Loading branch information
attozk committed Feb 17, 2014
1 parent aa24cf9 commit 42421f4
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions js/elFinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,23 @@ window.elFinder = function(node, opts) {
* @default {}
**/
this.customData = $.isPlainObject(this.options.customData) ? this.options.customData : {};


/**
* Any custom headers to send across every ajax request
*
* @type Object
* @default {}
*/
this.customHeaders = $.isPlainObject(this.options.customHeaders) ? this.options.customHeaders : {};

/**
* Any custom xhrFields to send across every ajax request
*
* @type Object
* @default {}
*/
this.xhrFields = $.isPlainObject(this.options.xhrFields) ? this.options.xhrFields : {};

/**
* ID. Required to create unique cookie name
*
Expand Down Expand Up @@ -871,7 +887,9 @@ window.elFinder = function(node, opts) {
dataType : 'json',
cache : false,
// timeout : 100,
data : data
data : data,
headers : this.customHeaders,
xhrFields: this.xhrFields,
}, options.options || {}),
/**
* Default success handler.
Expand Down

0 comments on commit 42421f4

Please sign in to comment.