Fixed response type check for ajax requests
authorAlexander Ebert <ebert@woltlab.com>
Thu, 21 Jul 2016 12:50:10 +0000 (14:50 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 21 Jul 2016 12:50:10 +0000 (14:50 +0200)
wcfsetup/install/files/js/WoltLab/WCF/Ajax/Request.js

index 22f618fe4c85bde3ad1ca39eb5168ac8af8489cb..ccb4e19eaa88ab298cbe0d42a39bba67468d9215 100644 (file)
@@ -111,7 +111,7 @@ define(['Core', 'Language', 'Dom/ChangeListener', 'Dom/Util', 'Ui/Dialog', 'Wolt
                        this._xhr.onload = function() {
                                if (this.readyState === XMLHttpRequest.DONE) {
                                        if (this.status >= 200 && this.status < 300 || this.status === 304) {
-                                               if (options.responseType && options.responseType !== this.getResponseHeader('Content-Type')) {
+                                               if (options.responseType && this.getResponseHeader('Content-Type').indexOf(options.responseType) !== 0) {
                                                        // request succeeded but invalid response type
                                                        self._failure(this, options);
                                                }