pixl-xyapp 2.1.23 → 2.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js/base.js +6 -0
- package/package.json +1 -1
package/js/base.js
CHANGED
|
@@ -298,6 +298,12 @@ var app = {
|
|
|
298
298
|
// send HTTP GET to API endpoint
|
|
299
299
|
// Debug.trace('api', "Sending API request: " + url );
|
|
300
300
|
|
|
301
|
+
// add csrf token if we have one
|
|
302
|
+
if (app.csrf_token && (opts.method == 'POST')) {
|
|
303
|
+
if (!opts.headers) opts.headers = {};
|
|
304
|
+
opts.headers['X-CSRF-Token'] = app.csrf_token;
|
|
305
|
+
}
|
|
306
|
+
|
|
301
307
|
// default 10 sec timeout
|
|
302
308
|
var timeout = opts.timeout || 10000;
|
|
303
309
|
delete opts.timeout;
|
package/package.json
CHANGED