Prechádzať zdrojové kódy

ignore invalid content types

Gildas 7 rokov pred
rodič
commit
d0ecefa03f
1 zmenil súbory, kde vykonal 4 pridanie a 0 odobranie
  1. 4 0
      lib/single-file/single-file-browser.js

+ 4 - 0
lib/single-file/single-file-browser.js

@@ -82,6 +82,10 @@ this.SingleFile = this.SingleFile || (() => {
 			if (contentType) {
 				contentType = contentType.match(/^([^;]*)/)[0];
 			}
+			if (contentType.indexOf("/") <= 0) {
+				debugger
+				contentType = null;
+			}
 			if (options && options.asDataURI) {
 				try {
 					const buffer = await resourceContent.arrayBuffer();