Improved CORS credentials support
authorAlexander Ebert <ebert@woltlab.com>
Thu, 15 Dec 2016 10:05:20 +0000 (11:05 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 15 Dec 2016 10:05:20 +0000 (11:05 +0100)
wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js

index f8010ad16ddff2ccffe81dbb7928b5b55dab7887..c7a82ee9b4b9276a3f7abf5c489ecd117babb1db 100644 (file)
@@ -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);
                        }