فهرست منبع

Fixed ajax loader for mxl using old mimetype.

Benjamin Giesinger 7 سال پیش
والد
کامیت
ae8c5e15af
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      src/OpenSheetMusicDisplay/AJAX.ts

+ 2 - 1
src/OpenSheetMusicDisplay/AJAX.ts

@@ -11,6 +11,7 @@ export class AJAX {
      */
     public static ajax(url: string): Promise<string> {
         let xhttp: XMLHttpRequest;
+        const mimeType: string = url.indexOf(".mxl") > -1 ? "text/plain; charset=x-user-defined" : "application/xml";
         if (XMLHttpRequest) {
             xhttp = new XMLHttpRequest();
         } else if (ActiveXObject) {
@@ -32,7 +33,7 @@ export class AJAX {
                     }
                 }
             };
-            xhttp.overrideMimeType("text/xml");
+            xhttp.overrideMimeType(mimeType);
             xhttp.open("GET", url, true);
             xhttp.send();
         });