Explorar o código

test 4xx on text to prevent CSS errors

Gildas %!s(int64=7) %!d(string=hai) anos
pai
achega
5fe357a4fa
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lib/single-file/single-file-browser.js

+ 1 - 1
lib/single-file/single-file-browser.js

@@ -106,7 +106,7 @@ this.SingleFile = this.SingleFile || (() => {
 					return "data:base64,";
 					return "data:base64,";
 				}
 				}
 			} else {
 			} else {
-				if (options.validateTextContentType && contentType && !contentType.startsWith(PREFIX_CONTENT_TYPE_TEXT)) {
+				if (resourceContent.status >= 400 || (options.validateTextContentType && contentType && !contentType.startsWith(PREFIX_CONTENT_TYPE_TEXT))) {
 					return "";
 					return "";
 				}
 				}
 				if (!charSet) {
 				if (!charSet) {