From: Alexander Ebert Date: Thu, 15 Dec 2016 10:05:20 +0000 (+0100) Subject: Improved CORS credentials support X-Git-Tag: 3.0.0_RC_2~51 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5a4c5344e1967f86e6b8d6cf8eb92c558352f7e1;p=GitHub%2FWoltLab%2FWCF.git Improved CORS credentials support --- 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); }