Bladeren bron

avoid infinite loop (fix #881)

Gildas 4 jaren geleden
bovenliggende
commit
7c31002739
1 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 2 2
      src/single-file/single-file-core.js

+ 2 - 2
src/single-file/single-file-core.js

@@ -1701,7 +1701,7 @@ class ProcessorHelper {
 				expectedType: "stylesheet",
 				acceptHeaders: options.acceptHeaders
 			});
-			if (!matchCharsetEquals(content.data, content.charset || options.charset)) {
+			if (!(matchCharsetEquals(content.data, content.charset) || matchCharsetEquals(content.data, options.charset))) {
 				options = Object.assign({}, options, { charset: getCharset(content.data) });
 				return util.getContent(resourceURL, {
 					maxResourceSize: options.maxResourceSize,
@@ -1779,7 +1779,7 @@ class ProcessorHelper {
 				expectedType: "stylesheet",
 				acceptHeaders: options.acceptHeaders
 			});
-			if (!matchCharsetEquals(content.data, content.charset || options.charset)) {
+			if (!(matchCharsetEquals(content.data, content.charset) || matchCharsetEquals(content.data, options.charset))) {
 				options = Object.assign({}, options, { charset: getCharset(content.data) });
 				return ProcessorHelper.resolveLinkStylesheetURLs(resourceURL, baseURI, options, workStylesheet);
 			}