From 5a4c5344e1967f86e6b8d6cf8eb92c558352f7e1 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 15 Dec 2016 11:05:20 +0100 Subject: [PATCH] Improved CORS credentials support --- wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js index f8010ad16d..c7a82ee9b4 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js @@ -66,6 +66,11 @@ define(['Core', 'Language', 'Dom/ChangeListener', 'Dom/Util', 'Ui/Dialog', 'Wolt this._options.url = WSC_API_URL + this._options.url; } + if (this._options.url.indexOf(WSC_API_URL) === 0) { + // allows allow credentials when querying the very own server + this._options.withCredentials = true; + } + if (this._options.pinData) { this._data = Core.extend({}, this._options.data); } -- 2.20.1