浏览代码

avoid infinite loop when charset is not supported (e.g. ibm437)

Gildas 4 年之前
父节点
当前提交
097376d620
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      lib/single-file/single-file-core.js

+ 8 - 1
lib/single-file/single-file-core.js

@@ -1627,7 +1627,14 @@ class ProcessorHelper {
 			});
 			if (!matchCharsetEquals(content.data, content.charset || options.charset)) {
 				options = Object.assign({}, options, { charset: getCharset(content.data) });
-				return getStylesheetContent(resourceURL);
+				return util.getContent(resourceURL, {
+					maxResourceSize: options.maxResourceSize,
+					maxResourceSizeEnabled: options.maxResourceSizeEnabled,
+					validateTextContentType: true,
+					frameId: options.frameId,
+					charset: options.charset,
+					resourceReferrer: options.resourceReferrer
+				});
 			} else {
 				return content;
 			}