Fixed detection of the JSON content-type
authorMarcel Werk <burntime@woltlab.com>
Wed, 6 May 2020 16:57:53 +0000 (18:57 +0200)
committerMarcel Werk <burntime@woltlab.com>
Wed, 6 May 2020 16:57:53 +0000 (18:57 +0200)
wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js

index f201b477696d1f785b1ce84b74f8b525497bec2f..6950908afaa2b085983a62f29aa97c82a8c684c3 100644 (file)
@@ -230,7 +230,7 @@ define(['Core', 'Language', 'Dom/ChangeListener', 'Dom/Util', 'Ui/Dialog', 'Wolt
                        
                        if (typeof options.success === 'function') {
                                var data = null;
-                               if (xhr.getResponseHeader('Content-Type') === 'application/json') {
+                               if (xhr.getResponseHeader('Content-Type').split(';', 1)[0].trim() === 'application/json') {
                                        try {
                                                data = JSON.parse(xhr.responseText);
                                        }